/*
 * TxMainFrame.java
 *
 * Created on March 25, 2007, 9:41 PM
 */

package edu.byu.isys413.group1E.gui;

import edu.byu.isys413.group1E.*;
import edu.byu.isys413.group1E.data.*;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.sql.SQLException;
import java.text.DecimalFormat;
import javax.swing.*;
import java.text.SimpleDateFormat;
import java.util.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;

/** This panel contains all of the tab information
 *
 * @author  tkulbeth
 */
public class MainFrame extends javax.swing.JFrame{
    
    Session session = null;
    CustomerBO cust = null;
    TransactionBO tx = null;
    PrintHandler ph = new PrintHandler();
    ConversionHandler ch = new ConversionHandler();
    RentalHandler rh = new RentalHandler();
    TxLineTableModel newModel = new TxLineTableModel();
    ArrayList<ForRentBO> RentalItemList = new ArrayList<ForRentBO>();
    ListSelectionModel listSelectionModel;
    int prevSelectedRow = -1;
    DecimalFormat fmt = new DecimalFormat();

    /** Creates new form TxMainFrame */
    public MainFrame() {
        initComponents();
        //set the decimal format
        fmt.setMinimumFractionDigits(2);
        fmt.setMaximumFractionDigits(2);
        this.session = this.getSession();
        this.label_empName.setText(this.session.getEmployee().getEmpFullName());
        this.label_storeAddress.setText(this.session.getStore().getFullAddress());
        listSelectionModel = this.jTable_TxLineList.getSelectionModel();                         //get the selection model that the table is using
        listSelectionModel.addListSelectionListener(new TableListener(newModel));                //add the new model
        RentalHandler rh = RentalHandler.getInstance();
        rentalCategories_cbo.setModel(new javax.swing.DefaultComboBoxModel(rh.getRentalCategoriesArray()));
        if(this.field_lookupRentalItem.getText().equals("<Enter Keyword>") || this.field_lookupRentalItem.getText().equals("")){
            RentalItemList = rh.getAvailableItemsByCategory((String)this.rentalCategories_cbo.getSelectedItem());
        }else{
            RentalItemList = rh.lookupByKeyword((String)this.rentalCategories_cbo.getSelectedItem(),this.field_lookupRentalItem.getText());
        }
        ArrayList<String> itemNames = new ArrayList<String>();
        for(int x=0; x<RentalItemList.size();x++){
            itemNames.add(RentalItemList.get(x).getConceptual().getDescription());
        }
        this.rentalList.setListData(rh.getInstance().getAllAvailableRentalProdDescriptions());
        this.rentalList.updateUI();
        this.jTable_TxLineList.setModel(newModel);                                               //set up the table according to the model and data structure
        this.jTable_TxLineList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);            //update the table with the new listener
        ListSelectionModel rowSM = this.jTable_TxLineList.getSelectionModel();
        rowSM.addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {
                //Ignore extra messages.
                if (e.getValueIsAdjusting()) return;
                
                ListSelectionModel lsm = (ListSelectionModel)e.getSource();
                if (lsm.isSelectionEmpty()) {
                    button_addItem.setEnabled(true);
                } else {
                    int selectedRow = lsm.getMinSelectionIndex();   //get the selected index
                    if(selectedRow != prevSelectedRow){ //if the user clicked on a different row, move to that one
                        prevSelectedRow = selectedRow;
                        displaySelected(selectedRow);
                    }else{                              //otherwise, deselect the current one
                        jTable_TxLineList.clearSelection();
                    }
                }
            }
        });
    }
    
    /** Creates new form TxMainFrame with the session information
     *
     *@param s contains the session object and information
     */
    public MainFrame(Session s) {
        initComponents();
        session = s;
        this.label_empName.setText(s.getEmployee().getEmpFullName());
        this.label_storeAddress.setText(s.getStore().getFullAddress());
        listSelectionModel = this.jTable_TxLineList.getSelectionModel();                              //get the selection model that the table is using
        listSelectionModel.addListSelectionListener(new TableListener(newModel));       //add the new model
        this.jTable_TxLineList.setModel(newModel);                                                    //set up the table according to the model and data structure
        this.jTable_TxLineList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);                                 //update the table with the new listener
        ListSelectionModel rowSM = this.jTable_TxLineList.getSelectionModel();
        rowSM.addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {
                //Ignore extra messages.
                if (e.getValueIsAdjusting()) return;
                
                ListSelectionModel lsm = (ListSelectionModel)e.getSource();
                if (lsm.isSelectionEmpty()) {
                    button_addItem.setEnabled(true);
                } else {
                    int selectedRow = lsm.getMinSelectionIndex();   //get the selected index
                    if(selectedRow != prevSelectedRow){ //if the user clicked on a different row, move to that one
                        prevSelectedRow = selectedRow;
                        displaySelected(selectedRow);
                    }else{                              //otherwise, deselect the current one
                        
                        jTable_TxLineList.clearSelection();
                    }
                }
            }
        });
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        jTextField2 = new javax.swing.JTextField();
        panel_North = new javax.swing.JPanel();
        label_MyStuffIcon = new javax.swing.JLabel();
        label_MyStuffStoreFront = new javax.swing.JLabel();
        panel_TxInfo = new javax.swing.JPanel();
        label_empName = new javax.swing.JLabel();
        label_storeAddress = new javax.swing.JLabel();
        label_emp = new javax.swing.JLabel();
        label_store = new javax.swing.JLabel();
        field_custName = new javax.swing.JTextField();
        button_manageCust = new javax.swing.JButton();
        label_custName = new javax.swing.JLabel();
        label_transID = new javax.swing.JLabel();
        field_transID = new javax.swing.JTextField();
        label_transStatus = new javax.swing.JLabel();
        panel_allTxOps = new javax.swing.JPanel();
        panel_tabs = new javax.swing.JPanel();
        jTabbedPanel = new javax.swing.JTabbedPane();
        saleTab = new javax.swing.JPanel();
        bkNorth6 = new javax.swing.JPanel();
        bknNorth6 = new javax.swing.JPanel();
        jLabel8 = new javax.swing.JLabel();
        bkCenter6 = new javax.swing.JPanel();
        EnterSKULabel = new javax.swing.JLabel();
        SKULabel = new javax.swing.JLabel();
        field_SKU = new javax.swing.JTextField();
        QtyLabel = new javax.swing.JLabel();
        field_Qty = new javax.swing.JTextField();
        rentalTab = new javax.swing.JPanel();
        Title2 = new javax.swing.JPanel();
        Text2 = new javax.swing.JLabel();
        RentalPane = new javax.swing.JPanel();
        leftPanel = new javax.swing.JPanel();
        RentalInfoFields = new javax.swing.JPanel();
        Editor3 = new javax.swing.JPanel();
        specs3 = new javax.swing.JLabel();
        typelabel3 = new javax.swing.JLabel();
        rentalCategories_cbo = new javax.swing.JComboBox();
        sizelabel3 = new javax.swing.JLabel();
        jSeparator14 = new javax.swing.JSeparator();
        jSeparator15 = new javax.swing.JSeparator();
        jLabel12 = new javax.swing.JLabel();
        field_lookupRentalItem = new javax.swing.JTextField();
        dateOutr = new javax.swing.JLabel();
        dateOut = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        dateDue = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        pricePerDay = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        replacementPrice = new javax.swing.JTextField();
        jLabel17 = new javax.swing.JLabel();
        maxTimesRented = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        lateFeePerDay = new javax.swing.JTextField();
        jLabel19 = new javax.swing.JLabel();
        sku = new javax.swing.JTextField();
        jLabel20 = new javax.swing.JLabel();
        productID = new javax.swing.JTextField();
        button_searchRentals = new javax.swing.JButton();
        RentalDescription = new javax.swing.JPanel();
        descrlabel2 = new javax.swing.JLabel();
        descpane2 = new javax.swing.JScrollPane();
        description = new javax.swing.JTextArea();
        rightPanel = new javax.swing.JPanel();
        rentalScrollPane = new javax.swing.JScrollPane();
        rentalList = new javax.swing.JList();
        backupTab = new javax.swing.JPanel();
        bkNorth = new javax.swing.JPanel();
        panel_addBackup = new javax.swing.JPanel();
        label_addBackup = new javax.swing.JLabel();
        label_existingBackup = new javax.swing.JLabel();
        jSeparator3 = new javax.swing.JSeparator();
        bkCenter = new javax.swing.JPanel();
        panel_backup = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        label_addSpaceGB = new javax.swing.JLabel();
        bkField_addSize = new javax.swing.JTextField();
        label_addCost = new javax.swing.JLabel();
        bkField_addCost = new javax.swing.JTextField();
        label_id = new javax.swing.JLabel();
        label_memberID = new javax.swing.JLabel();
        label_name = new javax.swing.JLabel();
        label_buSize = new javax.swing.JLabel();
        label_backupSize = new javax.swing.JLabel();
        label_memberName = new javax.swing.JLabel();
        label_curCost = new javax.swing.JLabel();
        label_currentCost = new javax.swing.JLabel();
        jSeparator_left1 = new javax.swing.JSeparator();
        jSeparator_right1 = new javax.swing.JSeparator();
        bkLabel_curExpDate = new javax.swing.JLabel();
        label_currentExpDate = new javax.swing.JLabel();
        repairTab = new javax.swing.JPanel();
        repNorth = new javax.swing.JPanel();
        repnNorth = new javax.swing.JPanel();
        label_repairItem = new javax.swing.JLabel();
        repnCenter = new javax.swing.JPanel();
        label_enterRepInfo = new javax.swing.JLabel();
        repnSouth = new javax.swing.JPanel();
        jSeparator2 = new javax.swing.JSeparator();
        repCenter = new javax.swing.JPanel();
        label_SKU = new javax.swing.JLabel();
        repField_sku = new javax.swing.JTextField();
        repField_completeDate = new javax.swing.JTextField();
        label_startDate = new javax.swing.JLabel();
        repField_startDate = new javax.swing.JTextField();
        label_pickUp = new javax.swing.JLabel();
        repField_pickUp = new javax.swing.JTextField();
        label_lastNotice = new javax.swing.JLabel();
        repField_lastNotice = new javax.swing.JTextField();
        label_lbrHrs = new javax.swing.JLabel();
        repField_laborHrs = new javax.swing.JTextField();
        label_price = new javax.swing.JLabel();
        repField_price = new javax.swing.JTextField();
        label_contactMethod = new javax.swing.JLabel();
        repCboBox_contactMethod = new javax.swing.JComboBox();
        label_dateComplete = new javax.swing.JLabel();
        repSouth = new javax.swing.JPanel();
        repsNorth = new javax.swing.JPanel();
        label_description = new javax.swing.JLabel();
        jScrollPane4 = new javax.swing.JScrollPane();
        repTxtArea_description = new javax.swing.JTextArea();
        photoTab = new javax.swing.JPanel();
        Title = new javax.swing.JPanel();
        Text = new javax.swing.JLabel();
        Content1 = new javax.swing.JPanel();
        Top1 = new javax.swing.JPanel();
        Editor1 = new javax.swing.JPanel();
        specs1 = new javax.swing.JLabel();
        Copies1 = new javax.swing.JTextField();
        copies1 = new javax.swing.JLabel();
        typelabel1 = new javax.swing.JLabel();
        typeselect1 = new javax.swing.JComboBox();
        sizelabel1 = new javax.swing.JLabel();
        sizeselect1 = new javax.swing.JComboBox();
        format1 = new javax.swing.JLabel();
        formatselect1 = new javax.swing.JComboBox();
        batchlabel1 = new javax.swing.JLabel();
        batchenter1 = new javax.swing.JTextField();
        jSeparator6 = new javax.swing.JSeparator();
        jSeparator7 = new javax.swing.JSeparator();
        PhotoSetSelect1 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        psJdrop = new javax.swing.JComboBox();
        manage = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        Bottom1 = new javax.swing.JPanel();
        descrlabel = new javax.swing.JLabel();
        descpane = new javax.swing.JScrollPane();
        descr = new javax.swing.JTextArea();
        conversionTab = new javax.swing.JPanel();
        Title1 = new javax.swing.JPanel();
        Text1 = new javax.swing.JLabel();
        Content2 = new javax.swing.JPanel();
        Top2 = new javax.swing.JPanel();
        Editor2 = new javax.swing.JPanel();
        specs2 = new javax.swing.JLabel();
        Copies2 = new javax.swing.JTextField();
        copies2 = new javax.swing.JLabel();
        typelabel2 = new javax.swing.JLabel();
        convSerdrop = new javax.swing.JComboBox();
        sizelabel2 = new javax.swing.JLabel();
        jSeparator8 = new javax.swing.JSeparator();
        jSeparator9 = new javax.swing.JSeparator();
        jLabel10 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        discount = new javax.swing.JLabel();
        Bottom2 = new javax.swing.JPanel();
        descrlabel1 = new javax.swing.JLabel();
        descpane1 = new javax.swing.JScrollPane();
        descr1 = new javax.swing.JTextArea();
        returnTab = new javax.swing.JPanel();
        bknNorth3 = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        field_TransID = new javax.swing.JTextField();
        TransLabel = new javax.swing.JLabel();
        Return_Label = new javax.swing.JLabel();
        LookupTransaction_Button = new javax.swing.JButton();
        jSeparator10 = new javax.swing.JSeparator();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        field_OldTransactionID = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        textArea_oldTXLines = new javax.swing.JTextArea();
        jLabel9 = new javax.swing.JLabel();
        field_ReturnQuantity = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        SvcTransLookup = new javax.swing.JPanel();
        bknNorth4 = new javax.swing.JPanel();
        label_svcTransactionLookup = new javax.swing.JLabel();
        svcTransField_id = new javax.swing.JTextField();
        TransLabel1 = new javax.swing.JLabel();
        Return_Label1 = new javax.swing.JLabel();
        jSeparator12 = new javax.swing.JSeparator();
        button_lookupSvcTrans = new javax.swing.JButton();
        jSeparator13 = new javax.swing.JSeparator();
        NightlyBatch = new javax.swing.JPanel();
        repNorth1 = new javax.swing.JPanel();
        repnNorth1 = new javax.swing.JPanel();
        label_repairItem1 = new javax.swing.JLabel();
        repnCenter1 = new javax.swing.JPanel();
        label_enterRepInfo1 = new javax.swing.JLabel();
        repnSouth1 = new javax.swing.JPanel();
        jSeparator4 = new javax.swing.JSeparator();
        repCenter1 = new javax.swing.JPanel();
        label_lastNotice1 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        repSouth1 = new javax.swing.JPanel();
        panel_itemButtons = new javax.swing.JPanel();
        button_addItem = new javax.swing.JButton();
        button_clearItem = new javax.swing.JButton();
        separator_txL_ops = new javax.swing.JSeparator();
        panel_transLines = new javax.swing.JPanel();
        jSeparator1 = new javax.swing.JSeparator();
        label_transLine = new javax.swing.JLabel();
        panel_listButtons = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        scrollPane_txLineList = new javax.swing.JScrollPane();
        jTable_TxLineList = new javax.swing.JTable();
        panel_checkout = new javax.swing.JPanel();
        label_Checkout = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        field_pmtChange = new javax.swing.JTextField();
        label_change = new javax.swing.JLabel();
        label_paymentMethod = new javax.swing.JLabel();
        field_pmtAmount = new javax.swing.JTextField();
        cboBox_pmtMethod = new javax.swing.JComboBox();
        label_amount = new javax.swing.JLabel();
        jSeparator11 = new javax.swing.JSeparator();
        panel_cancelSaveButtons = new javax.swing.JPanel();
        button_cancelTrans = new javax.swing.JButton();
        button_payTrans = new javax.swing.JButton();
        button_applyCoupons = new javax.swing.JButton();
        button_deleteTxLine = new javax.swing.JButton();
        button_savePendingTx = new javax.swing.JButton();
        panel_listTotals = new javax.swing.JPanel();
        panel_totals = new javax.swing.JPanel();
        label_subTotal = new javax.swing.JLabel();
        field_subTotal = new javax.swing.JTextField();
        label_tax = new javax.swing.JLabel();
        field_tax = new javax.swing.JTextField();
        label_total = new javax.swing.JLabel();
        field_total = new javax.swing.JTextField();
        label_discount = new javax.swing.JLabel();
        field_discount = new javax.swing.JTextField();

        jTextField2.setText("jTextField2");
        jTextField2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField2ActionPerformed(evt);
            }
        });

        getContentPane().setLayout(new java.awt.GridBagLayout());

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Transaction Main Frame");
        setMaximizedBounds(new java.awt.Rectangle(0, 0, 1024, 760));
        panel_North.setLayout(new javax.swing.BoxLayout(panel_North, javax.swing.BoxLayout.X_AXIS));

        panel_North.setBackground(new java.awt.Color(0, 0, 51));
        panel_North.setMinimumSize(new java.awt.Dimension(1024, 50));
        panel_North.setPreferredSize(new java.awt.Dimension(1024, 50));
        label_MyStuffIcon.setForeground(new java.awt.Color(255, 255, 255));
        label_MyStuffIcon.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        label_MyStuffIcon.setIcon(new javax.swing.JLabel() {
            public javax.swing.Icon getIcon() {
                try {
                    return new javax.swing.ImageIcon(
                        new java.net.URL("https://siebelstg.provo.novell.com/travis/otherfiles/Logo.jpg")
                    );
                } catch (java.net.MalformedURLException e) {
                }
                return null;
            }
        }.getIcon());
        label_MyStuffIcon.setMaximumSize(new java.awt.Dimension(80, 50));
        label_MyStuffIcon.setMinimumSize(new java.awt.Dimension(80, 50));
        label_MyStuffIcon.setPreferredSize(new java.awt.Dimension(80, 50));
        panel_North.add(label_MyStuffIcon);

        label_MyStuffStoreFront.setFont(new java.awt.Font("Tahoma", 0, 24));
        label_MyStuffStoreFront.setForeground(new java.awt.Color(255, 255, 255));
        label_MyStuffStoreFront.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        label_MyStuffStoreFront.setText("   MyStuff - Storefront");
        label_MyStuffStoreFront.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
        label_MyStuffStoreFront.setMaximumSize(new java.awt.Dimension(300, 50));
        label_MyStuffStoreFront.setMinimumSize(new java.awt.Dimension(300, 50));
        label_MyStuffStoreFront.setPreferredSize(new java.awt.Dimension(300, 50));
        panel_North.add(label_MyStuffStoreFront);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
        getContentPane().add(panel_North, gridBagConstraints);

        panel_TxInfo.setLayout(new java.awt.GridBagLayout());

        panel_TxInfo.setMaximumSize(new java.awt.Dimension(1024, 50));
        panel_TxInfo.setMinimumSize(new java.awt.Dimension(1024, 50));
        panel_TxInfo.setPreferredSize(new java.awt.Dimension(1024, 50));
        label_empName.setText("Travis Kulbeth");
        label_empName.setMaximumSize(new java.awt.Dimension(600, 25));
        label_empName.setMinimumSize(new java.awt.Dimension(400, 25));
        label_empName.setPreferredSize(new java.awt.Dimension(400, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        panel_TxInfo.add(label_empName, gridBagConstraints);

        label_storeAddress.setText("1234 North Woodsong Way, Colorado Springs, CO 80911");
        label_storeAddress.setMaximumSize(new java.awt.Dimension(600, 25));
        label_storeAddress.setMinimumSize(new java.awt.Dimension(400, 25));
        label_storeAddress.setPreferredSize(new java.awt.Dimension(400, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 0;
        panel_TxInfo.add(label_storeAddress, gridBagConstraints);

        label_emp.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        label_emp.setText("Employee: ");
        label_emp.setMaximumSize(new java.awt.Dimension(200, 25));
        label_emp.setMinimumSize(new java.awt.Dimension(100, 25));
        label_emp.setPreferredSize(new java.awt.Dimension(100, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 1;
        panel_TxInfo.add(label_emp, gridBagConstraints);

        label_store.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        label_store.setText("Store: ");
        label_store.setMaximumSize(new java.awt.Dimension(200, 25));
        label_store.setMinimumSize(new java.awt.Dimension(100, 25));
        label_store.setPreferredSize(new java.awt.Dimension(100, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 0;
        panel_TxInfo.add(label_store, gridBagConstraints);

        field_custName.setText("<cust name>");
        field_custName.setMaximumSize(new java.awt.Dimension(230, 25));
        field_custName.setMinimumSize(new java.awt.Dimension(230, 25));
        field_custName.setPreferredSize(new java.awt.Dimension(230, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        panel_TxInfo.add(field_custName, gridBagConstraints);

        button_manageCust.setText("Find/Manage Customer");
        button_manageCust.setMaximumSize(new java.awt.Dimension(150, 23));
        button_manageCust.setMinimumSize(new java.awt.Dimension(150, 23));
        button_manageCust.setPreferredSize(new java.awt.Dimension(150, 23));
        button_manageCust.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button_manageCustActionPerformed(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 0;
        panel_TxInfo.add(button_manageCust, gridBagConstraints);

        label_custName.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        label_custName.setText("Customer: ");
        label_custName.setMaximumSize(new java.awt.Dimension(130, 25));
        label_custName.setMinimumSize(new java.awt.Dimension(130, 25));
        label_custName.setPreferredSize(new java.awt.Dimension(130, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        panel_TxInfo.add(label_custName, gridBagConstraints);

        label_transID.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        label_transID.setText("Transaction ID: ");
        label_transID.setMaximumSize(new java.awt.Dimension(130, 25));
        label_transID.setMinimumSize(new java.awt.Dimension(130, 25));
        label_transID.setPreferredSize(new java.awt.Dimension(130, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        panel_TxInfo.add(label_transID, gridBagConstraints);

        field_transID.setText("<trans id>");
        field_transID.setMaximumSize(new java.awt.Dimension(230, 25));
        field_transID.setMinimumSize(new java.awt.Dimension(230, 25));
        field_transID.setPreferredSize(new java.awt.Dimension(230, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        panel_TxInfo.add(field_transID, gridBagConstraints);

        label_transStatus.setForeground(new java.awt.Color(153, 0, 0));
        label_transStatus.setText("<status>");
        label_transStatus.setMaximumSize(new java.awt.Dimension(150, 25));
        label_transStatus.setMinimumSize(new java.awt.Dimension(150, 25));
        label_transStatus.setPreferredSize(new java.awt.Dimension(150, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        panel_TxInfo.add(label_transStatus, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        getContentPane().add(panel_TxInfo, gridBagConstraints);

        panel_allTxOps.setLayout(new javax.swing.BoxLayout(panel_allTxOps, javax.swing.BoxLayout.X_AXIS));

        panel_allTxOps.setMaximumSize(new java.awt.Dimension(1024, 660));
        panel_allTxOps.setMinimumSize(new java.awt.Dimension(1024, 560));
        panel_allTxOps.setPreferredSize(new java.awt.Dimension(1024, 560));
        panel_tabs.setLayout(new java.awt.BorderLayout());

        panel_tabs.setMinimumSize(new java.awt.Dimension(531, 550));
        panel_tabs.setPreferredSize(new java.awt.Dimension(531, 550));
        jTabbedPanel.setMaximumSize(new java.awt.Dimension(536, 32767));
        jTabbedPanel.setMinimumSize(new java.awt.Dimension(531, 485));
        jTabbedPanel.setName("Tabs");
        jTabbedPanel.setPreferredSize(new java.awt.Dimension(531, 485));
        jTabbedPanel.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jTabbedPanelMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jTabbedPanelMouseEntered(evt);
            }
            public void mousePressed(java.awt.event.MouseEvent evt) {
                popPrint(evt);
            }
        });

        bkNorth6.setLayout(new java.awt.BorderLayout());

        bkNorth6.setMaximumSize(new java.awt.Dimension(531, 2147483647));
        bkNorth6.setMinimumSize(new java.awt.Dimension(531, 10));
        bkNorth6.setPreferredSize(new java.awt.Dimension(531, 100));
        bkNorth6.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                bkNorth6FocusGained(evt);
            }
        });

        bknNorth6.setLayout(new java.awt.BorderLayout());

        bknNorth6.setBackground(new java.awt.Color(153, 153, 255));
        bknNorth6.setForeground(new java.awt.Color(102, 0, 102));
        bknNorth6.setMinimumSize(new java.awt.Dimension(531, 44));
        bknNorth6.setPreferredSize(new java.awt.Dimension(531, 44));
        jLabel8.setBackground(new java.awt.Color(102, 0, 0));
        jLabel8.setFont(new java.awt.Font("Tahoma", 0, 36));
        jLabel8.setForeground(new java.awt.Color(255, 255, 255));
        jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel8.setText("Sell an Item");
        jLabel8.setFocusable(false);
        bknNorth6.add(jLabel8, java.awt.BorderLayout.CENTER);

        bkNorth6.add(bknNorth6, java.awt.BorderLayout.NORTH);

        bkCenter6.setMaximumSize(new java.awt.Dimension(531, 2147483647));
        bkCenter6.setMinimumSize(new java.awt.Dimension(531, 10));
        bkCenter6.setPreferredSize(new java.awt.Dimension(531, 100));
        EnterSKULabel.setFont(new java.awt.Font("Arial", 0, 18));
        EnterSKULabel.setText("Enter the SKU");

        SKULabel.setText("SKU");

        field_SKU.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                field_SKUFocusGained(evt);
            }
        });

        QtyLabel.setText("Quantity");

        javax.swing.GroupLayout bkCenter6Layout = new javax.swing.GroupLayout(bkCenter6);
        bkCenter6.setLayout(bkCenter6Layout);
        bkCenter6Layout.setHorizontalGroup(
            bkCenter6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(bkCenter6Layout.createSequentialGroup()
                .addGroup(bkCenter6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(bkCenter6Layout.createSequentialGroup()
                        .addGap(193, 193, 193)
                        .addComponent(EnterSKULabel))
                    .addGroup(bkCenter6Layout.createSequentialGroup()
                        .addGap(79, 79, 79)
                        .addGroup(bkCenter6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(QtyLabel, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(SKULabel, javax.swing.GroupLayout.Alignment.TRAILING))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(bkCenter6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(field_Qty)
                            .addComponent(field_SKU, javax.swing.GroupLayout.DEFAULT_SIZE, 366, Short.MAX_VALUE))))
                .addContainerGap(40, Short.MAX_VALUE))
        );
        bkCenter6Layout.setVerticalGroup(
            bkCenter6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(bkCenter6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(EnterSKULabel, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(17, 17, 17)
                .addGroup(bkCenter6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(SKULabel)
                    .addComponent(field_SKU, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(bkCenter6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(QtyLabel)
                    .addComponent(field_Qty, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(374, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout saleTabLayout = new javax.swing.GroupLayout(saleTab);
        saleTab.setLayout(saleTabLayout);
        saleTabLayout.setHorizontalGroup(
            saleTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(saleTabLayout.createSequentialGroup()
                .addComponent(bkNorth6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(13, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, saleTabLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(bkCenter6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        saleTabLayout.setVerticalGroup(
            saleTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(saleTabLayout.createSequentialGroup()
                .addComponent(bkNorth6, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(bkCenter6, javax.swing.GroupLayout.PREFERRED_SIZE, 491, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(29, 29, 29))
        );
        jTabbedPanel.addTab("Sale", saleTab);
        saleTab.getAccessibleContext().setAccessibleName("saleTab");

        rentalTab.setLayout(new java.awt.BorderLayout());

        rentalTab.setMinimumSize(new java.awt.Dimension(577, 450));
        rentalTab.setPreferredSize(new java.awt.Dimension(577, 450));
        Title2.setLayout(new java.awt.BorderLayout());

        Title2.setBackground(new java.awt.Color(0, 0, 51));
        Title2.setMinimumSize(new java.awt.Dimension(531, 44));
        Title2.setPreferredSize(new java.awt.Dimension(531, 44));
        Text2.setBackground(new java.awt.Color(102, 0, 0));
        Text2.setFont(new java.awt.Font("Tahoma", 0, 36));
        Text2.setForeground(new java.awt.Color(255, 255, 255));
        Text2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        Text2.setText("Rental");
        Text2.setFocusable(false);
        Title2.add(Text2, java.awt.BorderLayout.CENTER);

        rentalTab.add(Title2, java.awt.BorderLayout.NORTH);

        RentalPane.setLayout(new java.awt.GridBagLayout());

        RentalPane.setMaximumSize(new java.awt.Dimension(2147483647, 400));
        leftPanel.setLayout(new java.awt.GridBagLayout());

        leftPanel.setPreferredSize(new java.awt.Dimension(235, 400));
        RentalInfoFields.setLayout(new java.awt.GridBagLayout());

        Editor3.setLayout(new java.awt.GridBagLayout());

        specs3.setFont(new java.awt.Font("Tahoma", 1, 12));
        specs3.setText("Rental Lookup");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
        Editor3.add(specs3, gridBagConstraints);

        typelabel3.setText("Select a Category:    ");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        Editor3.add(typelabel3, gridBagConstraints);

        rentalCategories_cbo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "<select category>", "Digital Cameras", "Tripods", "Etc" }));
        rentalCategories_cbo.addPopupMenuListener(new javax.swing.event.PopupMenuListener() {
            public void popupMenuCanceled(javax.swing.event.PopupMenuEvent evt) {
            }
            public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent evt) {
            }
            public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {
                rentalCategories_cboPopupMenuWillBecomeVisible(evt);
            }
        });
        rentalCategories_cbo.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                rentalCategories_cboItemStateChanged(evt);
            }
        });
        rentalCategories_cbo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rentalCategories_cboActionPerformed(evt);
            }
        });
        rentalCategories_cbo.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                rentalCategories_cboPropertyChange(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        Editor3.add(rentalCategories_cbo, gridBagConstraints);

        sizelabel3.setText("Lookup Rental Item:  ");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        Editor3.add(sizelabel3, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
        Editor3.add(jSeparator14, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
        Editor3.add(jSeparator15, gridBagConstraints);

        jLabel12.setText("                                          ");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
        Editor3.add(jLabel12, gridBagConstraints);

        field_lookupRentalItem.setText("<Enter Keyword>");
        field_lookupRentalItem.setMinimumSize(new java.awt.Dimension(6, 90));
        field_lookupRentalItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                field_lookupRentalItemActionPerformed(evt);
            }
        });
        field_lookupRentalItem.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                field_lookupRentalItemFocusGained(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.ipadx = 6;
        Editor3.add(field_lookupRentalItem, gridBagConstraints);

        dateOutr.setText("Date Out:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 5;
        Editor3.add(dateOutr, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.ipadx = 2;
        Editor3.add(dateOut, gridBagConstraints);

        jLabel14.setText("Date Due:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 6;
        Editor3.add(jLabel14, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 6;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.ipadx = 2;
        gridBagConstraints.ipady = 2;
        Editor3.add(dateDue, gridBagConstraints);

        jLabel15.setText("Price Per Day:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 7;
        Editor3.add(jLabel15, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 7;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        Editor3.add(pricePerDay, gridBagConstraints);

        jLabel16.setText("Replacement Price:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 8;
        Editor3.add(jLabel16, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 8;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        Editor3.add(replacementPrice, gridBagConstraints);

        jLabel17.setText("Max Times Rented:  ");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 9;
        Editor3.add(jLabel17, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 9;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        Editor3.add(maxTimesRented, gridBagConstraints);

        jLabel18.setText("Late Fee Per Day:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 10;
        Editor3.add(jLabel18, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 10;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        Editor3.add(lateFeePerDay, gridBagConstraints);

        jLabel19.setText("SKU:  ");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 11;
        Editor3.add(jLabel19, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 11;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        Editor3.add(sku, gridBagConstraints);

        jLabel20.setText("ProductID:  ");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 12;
        Editor3.add(jLabel20, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 12;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        Editor3.add(productID, gridBagConstraints);

        button_searchRentals.setText("Go");
        button_searchRentals.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button_searchRentalsActionPerformed(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        Editor3.add(button_searchRentals, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
        RentalInfoFields.add(Editor3, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
        gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
        leftPanel.add(RentalInfoFields, gridBagConstraints);

        descrlabel2.setFont(new java.awt.Font("Tahoma", 1, 11));
        descrlabel2.setText("Description of Rental Item");

        descpane2.setMinimumSize(new java.awt.Dimension(300, 300));
        description.setColumns(20);
        description.setRows(5);
        descpane2.setViewportView(description);

        javax.swing.GroupLayout RentalDescriptionLayout = new javax.swing.GroupLayout(RentalDescription);
        RentalDescription.setLayout(RentalDescriptionLayout);
        RentalDescriptionLayout.setHorizontalGroup(
            RentalDescriptionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(RentalDescriptionLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(RentalDescriptionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(descpane2, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(descrlabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        RentalDescriptionLayout.setVerticalGroup(
            RentalDescriptionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(RentalDescriptionLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(descrlabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(descpane2, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 9, 0);
        leftPanel.add(RentalDescription, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
        RentalPane.add(leftPanel, gridBagConstraints);

        rightPanel.setLayout(new java.awt.GridBagLayout());

        rightPanel.setMaximumSize(new java.awt.Dimension(342, 400));
        rightPanel.setMinimumSize(new java.awt.Dimension(342, 400));
        rightPanel.setPreferredSize(new java.awt.Dimension(342, 400));
        rentalScrollPane.setMaximumSize(new java.awt.Dimension(342, 400));
        rentalScrollPane.setMinimumSize(new java.awt.Dimension(342, 400));
        rentalScrollPane.setPreferredSize(new java.awt.Dimension(342, 400));
        rentalList.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        rentalList.setMaximumSize(new java.awt.Dimension(200, 400));
        rentalList.setMinimumSize(new java.awt.Dimension(200, 400));
        rentalList.setPreferredSize(new java.awt.Dimension(200, 400));
        rentalList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
            public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
                rentalListValueChanged(evt);
            }
        });

        rentalScrollPane.setViewportView(rentalList);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 10);
        rightPanel.add(rentalScrollPane, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
        RentalPane.add(rightPanel, gridBagConstraints);

        rentalTab.add(RentalPane, java.awt.BorderLayout.WEST);

        jTabbedPanel.addTab("Rental", rentalTab);

        backupTab.setLayout(new java.awt.GridBagLayout());

        backupTab.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                backupTabFocusGained(evt);
            }
        });

        bkNorth.setLayout(new java.awt.BorderLayout());

        bkNorth.setMaximumSize(new java.awt.Dimension(531, 2147483647));
        bkNorth.setMinimumSize(new java.awt.Dimension(531, 80));
        bkNorth.setPreferredSize(new java.awt.Dimension(531, 80));
        bkNorth.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                bkNorthFocusGained(evt);
            }
        });

        panel_addBackup.setBackground(new java.awt.Color(0, 102, 51));
        panel_addBackup.setMinimumSize(new java.awt.Dimension(531, 50));
        panel_addBackup.setPreferredSize(new java.awt.Dimension(531, 50));
        label_addBackup.setBackground(new java.awt.Color(0, 102, 51));
        label_addBackup.setFont(new java.awt.Font("Tahoma", 0, 36));
        label_addBackup.setForeground(new java.awt.Color(255, 255, 255));
        label_addBackup.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        label_addBackup.setText("Add a Backup");
        label_addBackup.setFocusable(false);
        label_addBackup.setMinimumSize(new java.awt.Dimension(531, 50));
        label_addBackup.setPreferredSize(new java.awt.Dimension(531, 50));

        javax.swing.GroupLayout panel_addBackupLayout = new javax.swing.GroupLayout(panel_addBackup);
        panel_addBackup.setLayout(panel_addBackupLayout);
        panel_addBackupLayout.setHorizontalGroup(
            panel_addBackupLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(label_addBackup, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        panel_addBackupLayout.setVerticalGroup(
            panel_addBackupLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(label_addBackup, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        bkNorth.add(panel_addBackup, java.awt.BorderLayout.NORTH);

        label_existingBackup.setFont(new java.awt.Font("Times New Roman", 1, 18));
        label_existingBackup.setText("Existing Backup Information: ");
        label_existingBackup.setMinimumSize(new java.awt.Dimension(531, 30));
        label_existingBackup.setPreferredSize(new java.awt.Dimension(531, 30));
        bkNorth.add(label_existingBackup, java.awt.BorderLayout.CENTER);

        bkNorth.add(jSeparator3, java.awt.BorderLayout.SOUTH);

        backupTab.add(bkNorth, new java.awt.GridBagConstraints());

        bkCenter.setLayout(new java.awt.BorderLayout());

        bkCenter.setMaximumSize(new java.awt.Dimension(531, 2147483647));
        bkCenter.setMinimumSize(new java.awt.Dimension(531, 230));
        bkCenter.setPreferredSize(new java.awt.Dimension(531, 230));
        panel_backup.setLayout(new java.awt.GridBagLayout());

        panel_backup.setMinimumSize(new java.awt.Dimension(531, 200));
        panel_backup.setPreferredSize(new java.awt.Dimension(531, 200));
        jPanel3.setLayout(new java.awt.GridBagLayout());

        jPanel3.setMinimumSize(new java.awt.Dimension(230, 50));
        jPanel3.setPreferredSize(new java.awt.Dimension(230, 50));
        label_addSpaceGB.setText("Additional Space (GB): ");
        jPanel3.add(label_addSpaceGB, new java.awt.GridBagConstraints());

        bkField_addSize.setText("<size>");
        bkField_addSize.setMinimumSize(new java.awt.Dimension(60, 25));
        bkField_addSize.setPreferredSize(new java.awt.Dimension(60, 25));
        bkField_addSize.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                bkField_addSizeFocusGained(evt);
            }
            public void focusLost(java.awt.event.FocusEvent evt) {
                bkField_addSizeFocusLost(evt);
            }
        });

        jPanel3.add(bkField_addSize, new java.awt.GridBagConstraints());

        label_addCost.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        label_addCost.setText("Additional Cost: $");
        label_addCost.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        jPanel3.add(label_addCost, gridBagConstraints);

        bkField_addCost.setEditable(false);
        bkField_addCost.setText("<cost>");
        bkField_addCost.setMinimumSize(new java.awt.Dimension(60, 25));
        bkField_addCost.setPreferredSize(new java.awt.Dimension(60, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        jPanel3.add(bkField_addCost, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 6;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        panel_backup.add(jPanel3, gridBagConstraints);

        label_id.setText("Membership ID: ");
        label_id.setMinimumSize(new java.awt.Dimension(265, 25));
        label_id.setPreferredSize(new java.awt.Dimension(265, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        panel_backup.add(label_id, gridBagConstraints);

        label_memberID.setText("<membership id>");
        label_memberID.setMinimumSize(new java.awt.Dimension(265, 25));
        label_memberID.setPreferredSize(new java.awt.Dimension(265, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        panel_backup.add(label_memberID, gridBagConstraints);

        label_name.setText("Member Name: ");
        label_name.setMinimumSize(new java.awt.Dimension(265, 25));
        label_name.setPreferredSize(new java.awt.Dimension(265, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        panel_backup.add(label_name, gridBagConstraints);

        label_buSize.setText("Current Backup Size: ");
        label_buSize.setMinimumSize(new java.awt.Dimension(265, 25));
        label_buSize.setPreferredSize(new java.awt.Dimension(265, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        panel_backup.add(label_buSize, gridBagConstraints);

        label_backupSize.setText("<size>");
        label_backupSize.setMinimumSize(new java.awt.Dimension(265, 25));
        label_backupSize.setPreferredSize(new java.awt.Dimension(265, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        panel_backup.add(label_backupSize, gridBagConstraints);

        label_memberName.setText("<name>");
        label_memberName.setMinimumSize(new java.awt.Dimension(265, 25));
        label_memberName.setPreferredSize(new java.awt.Dimension(265, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        panel_backup.add(label_memberName, gridBagConstraints);

        label_curCost.setText("Current Cost (per 6 months): ");
        label_curCost.setMinimumSize(new java.awt.Dimension(265, 25));
        label_curCost.setPreferredSize(new java.awt.Dimension(265, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        panel_backup.add(label_curCost, gridBagConstraints);

        label_currentCost.setText("<current cost>");
        label_currentCost.setMinimumSize(new java.awt.Dimension(265, 25));
        label_currentCost.setPreferredSize(new java.awt.Dimension(265, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        panel_backup.add(label_currentCost, gridBagConstraints);

        jSeparator_left1.setMinimumSize(new java.awt.Dimension(265, 10));
        jSeparator_left1.setPreferredSize(new java.awt.Dimension(265, 10));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 5;
        panel_backup.add(jSeparator_left1, gridBagConstraints);

        jSeparator_right1.setMinimumSize(new java.awt.Dimension(265, 10));
        jSeparator_right1.setPreferredSize(new java.awt.Dimension(265, 10));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 5;
        panel_backup.add(jSeparator_right1, gridBagConstraints);

        bkLabel_curExpDate.setText("Current Expiration Date:");
        bkLabel_curExpDate.setMinimumSize(new java.awt.Dimension(265, 25));
        bkLabel_curExpDate.setPreferredSize(new java.awt.Dimension(265, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        panel_backup.add(bkLabel_curExpDate, gridBagConstraints);

        label_currentExpDate.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        label_currentExpDate.setText("<current exp date>");
        label_currentExpDate.setMinimumSize(new java.awt.Dimension(265, 25));
        label_currentExpDate.setPreferredSize(new java.awt.Dimension(265, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        panel_backup.add(label_currentExpDate, gridBagConstraints);

        bkCenter.add(panel_backup, java.awt.BorderLayout.EAST);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 175, 0);
        backupTab.add(bkCenter, gridBagConstraints);

        jTabbedPanel.addTab("Backup", backupTab);
        backupTab.getAccessibleContext().setAccessibleName("backupTab");

        repairTab.setLayout(new java.awt.GridBagLayout());

        repairTab.setMaximumSize(new java.awt.Dimension(531, 32767));
        repairTab.setMinimumSize(new java.awt.Dimension(531, 300));
        repairTab.setPreferredSize(new java.awt.Dimension(531, 300));
        repNorth.setLayout(new java.awt.BorderLayout());

        repNorth.setMaximumSize(new java.awt.Dimension(531, 2147483647));
        repNorth.setMinimumSize(new java.awt.Dimension(531, 100));
        repNorth.setPreferredSize(new java.awt.Dimension(531, 100));
        repNorth.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                repNorthFocusGained(evt);
            }
        });

        repnNorth.setLayout(new java.awt.BorderLayout());

        repnNorth.setBackground(new java.awt.Color(102, 0, 0));
        repnNorth.setMinimumSize(new java.awt.Dimension(531, 44));
        repnNorth.setPreferredSize(new java.awt.Dimension(531, 44));
        label_repairItem.setBackground(new java.awt.Color(102, 0, 0));
        label_repairItem.setFont(new java.awt.Font("Tahoma", 0, 36));
        label_repairItem.setForeground(new java.awt.Color(255, 255, 255));
        label_repairItem.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        label_repairItem.setText("Repair an Item");
        label_repairItem.setFocusable(false);
        repnNorth.add(label_repairItem, java.awt.BorderLayout.CENTER);

        repNorth.add(repnNorth, java.awt.BorderLayout.NORTH);

        repnCenter.setLayout(new java.awt.BorderLayout());

        repnCenter.setMinimumSize(new java.awt.Dimension(531, 10));
        repnCenter.setPreferredSize(new java.awt.Dimension(531, 10));
        label_enterRepInfo.setFont(new java.awt.Font("Times New Roman", 1, 18));
        label_enterRepInfo.setText("Enter Service/Repair Information:");
        repnCenter.add(label_enterRepInfo, java.awt.BorderLayout.CENTER);

        repNorth.add(repnCenter, java.awt.BorderLayout.CENTER);

        repnSouth.setLayout(new java.awt.BorderLayout());

        repnSouth.setMinimumSize(new java.awt.Dimension(531, 10));
        repnSouth.setPreferredSize(new java.awt.Dimension(531, 10));
        repnSouth.add(jSeparator2, java.awt.BorderLayout.CENTER);

        repNorth.add(repnSouth, java.awt.BorderLayout.SOUTH);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
        repairTab.add(repNorth, gridBagConstraints);

        repCenter.setLayout(new java.awt.GridBagLayout());

        repCenter.setMaximumSize(new java.awt.Dimension(531, 100));
        repCenter.setMinimumSize(new java.awt.Dimension(531, 100));
        repCenter.setPreferredSize(new java.awt.Dimension(531, 100));
        label_SKU.setText("Product SKU:");
        label_SKU.setMinimumSize(new java.awt.Dimension(125, 25));
        label_SKU.setPreferredSize(new java.awt.Dimension(125, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        repCenter.add(label_SKU, gridBagConstraints);

        repField_sku.setText("<SKU>");
        repField_sku.setMinimumSize(new java.awt.Dimension(125, 25));
        repField_sku.setPreferredSize(new java.awt.Dimension(125, 25));
        repField_sku.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                repField_skuActionPerformed(evt);
            }
        });
        repField_sku.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                repField_skuFocusGained(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        repCenter.add(repField_sku, gridBagConstraints);

        repField_completeDate.setText("<date completed>");
        repField_completeDate.setMinimumSize(new java.awt.Dimension(125, 25));
        repField_completeDate.setPreferredSize(new java.awt.Dimension(125, 25));
        repField_completeDate.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                repField_completeDateFocusGained(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        repCenter.add(repField_completeDate, gridBagConstraints);

        label_startDate.setText("Date Started:");
        label_startDate.setMinimumSize(new java.awt.Dimension(125, 25));
        label_startDate.setPreferredSize(new java.awt.Dimension(125, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        repCenter.add(label_startDate, gridBagConstraints);

        repField_startDate.setText("<start date>");
        repField_startDate.setMinimumSize(new java.awt.Dimension(125, 25));
        repField_startDate.setPreferredSize(new java.awt.Dimension(125, 25));
        repField_startDate.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                repField_startDateFocusGained(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        repCenter.add(repField_startDate, gridBagConstraints);

        label_pickUp.setText(" Date Picked Up: ");
        label_pickUp.setMinimumSize(new java.awt.Dimension(125, 25));
        label_pickUp.setPreferredSize(new java.awt.Dimension(125, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        repCenter.add(label_pickUp, gridBagConstraints);

        repField_pickUp.setText("<pick up date>");
        repField_pickUp.setMinimumSize(new java.awt.Dimension(125, 25));
        repField_pickUp.setPreferredSize(new java.awt.Dimension(125, 25));
        repField_pickUp.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                repField_pickUpFocusGained(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        repCenter.add(repField_pickUp, gridBagConstraints);

        label_lastNotice.setText(" Last Notice Date: ");
        label_lastNotice.setMinimumSize(new java.awt.Dimension(125, 25));
        label_lastNotice.setPreferredSize(new java.awt.Dimension(125, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 2;
        repCenter.add(label_lastNotice, gridBagConstraints);

        repField_lastNotice.setText("<last notice date>");
        repField_lastNotice.setMinimumSize(new java.awt.Dimension(125, 25));
        repField_lastNotice.setPreferredSize(new java.awt.Dimension(125, 25));
        repField_lastNotice.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                repField_lastNoticeActionPerformed(evt);
            }
        });
        repField_lastNotice.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                repField_lastNoticeFocusGained(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        repCenter.add(repField_lastNotice, gridBagConstraints);

        label_lbrHrs.setText("Labor Hours: ");
        label_lbrHrs.setMinimumSize(new java.awt.Dimension(125, 25));
        label_lbrHrs.setPreferredSize(new java.awt.Dimension(125, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        repCenter.add(label_lbrHrs, gridBagConstraints);

        repField_laborHrs.setText("<labor hours>");
        repField_laborHrs.setMinimumSize(new java.awt.Dimension(125, 25));
        repField_laborHrs.setPreferredSize(new java.awt.Dimension(125, 25));
        repField_laborHrs.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                repField_laborHrsFocusGained(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        repCenter.add(repField_laborHrs, gridBagConstraints);

        label_price.setText(" Price: ");
        label_price.setMaximumSize(new java.awt.Dimension(100, 25));
        label_price.setMinimumSize(new java.awt.Dimension(125, 25));
        label_price.setPreferredSize(new java.awt.Dimension(125, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        repCenter.add(label_price, gridBagConstraints);

        repField_price.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        repField_price.setText("<price>");
        repField_price.setMinimumSize(new java.awt.Dimension(125, 25));
        repField_price.setPreferredSize(new java.awt.Dimension(125, 25));
        repField_price.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                repField_priceFocusGained(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        repCenter.add(repField_price, gridBagConstraints);

        label_contactMethod.setText(" Contact Method: ");
        label_contactMethod.setMinimumSize(new java.awt.Dimension(125, 25));
        label_contactMethod.setPreferredSize(new java.awt.Dimension(125, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        repCenter.add(label_contactMethod, gridBagConstraints);

        repCboBox_contactMethod.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "<Please Select>", "Phone", "Email", "Text Message", "Mail", "Fax" }));
        repCboBox_contactMethod.setMinimumSize(new java.awt.Dimension(125, 25));
        repCboBox_contactMethod.setPreferredSize(new java.awt.Dimension(125, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 3;
        repCenter.add(repCboBox_contactMethod, gridBagConstraints);

        label_dateComplete.setText(" Date Complete: ");
        label_dateComplete.setMinimumSize(new java.awt.Dimension(125, 25));
        label_dateComplete.setPreferredSize(new java.awt.Dimension(125, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        repCenter.add(label_dateComplete, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        repairTab.add(repCenter, gridBagConstraints);

        repSouth.setLayout(new java.awt.GridLayout(1, 0));

        repSouth.setMaximumSize(new java.awt.Dimension(531, 2147483647));
        repSouth.setMinimumSize(new java.awt.Dimension(531, 100));
        repSouth.setPreferredSize(new java.awt.Dimension(531, 100));
        repsNorth.setLayout(new java.awt.BorderLayout());

        repsNorth.setMinimumSize(new java.awt.Dimension(531, 100));
        repsNorth.setPreferredSize(new java.awt.Dimension(531, 100));
        label_description.setText("Description:");
        label_description.setMaximumSize(new java.awt.Dimension(75, 25));
        label_description.setMinimumSize(new java.awt.Dimension(75, 25));
        label_description.setPreferredSize(new java.awt.Dimension(75, 25));
        repsNorth.add(label_description, java.awt.BorderLayout.NORTH);

        repTxtArea_description.setColumns(20);
        repTxtArea_description.setRows(5);
        jScrollPane4.setViewportView(repTxtArea_description);

        repsNorth.add(jScrollPane4, java.awt.BorderLayout.CENTER);

        repSouth.add(repsNorth);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 200, 0);
        repairTab.add(repSouth, gridBagConstraints);

        jTabbedPanel.addTab("Repair", repairTab);
        repairTab.getAccessibleContext().setAccessibleName("repairTab");

        photoTab.setLayout(new java.awt.BorderLayout());

        Title.setLayout(new java.awt.BorderLayout());

        Title.setBackground(new java.awt.Color(102, 102, 0));
        Title.setMinimumSize(new java.awt.Dimension(531, 44));
        Title.setPreferredSize(new java.awt.Dimension(531, 44));
        Text.setBackground(new java.awt.Color(102, 0, 0));
        Text.setFont(new java.awt.Font("Tahoma", 0, 36));
        Text.setForeground(new java.awt.Color(255, 255, 255));
        Text.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        Text.setText("Photo Services");
        Text.setFocusable(false);
        Title.add(Text, java.awt.BorderLayout.CENTER);

        photoTab.add(Title, java.awt.BorderLayout.NORTH);

        Content1.setLayout(new java.awt.GridBagLayout());

        Top1.setLayout(new java.awt.GridBagLayout());

        Editor1.setLayout(new java.awt.GridBagLayout());

        specs1.setFont(new java.awt.Font("Tahoma", 1, 12));
        specs1.setText("Photo Specifications");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        Editor1.add(specs1, gridBagConstraints);

        Copies1.setText("1");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        Editor1.add(Copies1, gridBagConstraints);

        copies1.setText("Number of Print Copies: ");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        Editor1.add(copies1, gridBagConstraints);

        typelabel1.setText("Print Type: ");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        Editor1.add(typelabel1, gridBagConstraints);

        typeselect1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Film", "Digital" }));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        Editor1.add(typeselect1, gridBagConstraints);

        sizelabel1.setText("Print Size: ");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        Editor1.add(sizelabel1, gridBagConstraints);

        sizeselect1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "3 x 5", "4 x 6", "8 x 10", "8 x 10", "15 x 18" }));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        Editor1.add(sizeselect1, gridBagConstraints);

        format1.setText("Print Format: ");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        Editor1.add(format1, gridBagConstraints);

        formatselect1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Matte", "Glossy                                          " }));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        Editor1.add(formatselect1, gridBagConstraints);

        batchlabel1.setText("Number of Photos (Batch): ");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 7;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        Editor1.add(batchlabel1, gridBagConstraints);

        batchenter1.setText("1");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 7;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        Editor1.add(batchenter1, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        Editor1.add(jSeparator6, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        Editor1.add(jSeparator7, gridBagConstraints);

        PhotoSetSelect1.setText("Photo Set: ");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 6;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        Editor1.add(PhotoSetSelect1, gridBagConstraints);

        jLabel6.setText("                                          ");
        Editor1.add(jLabel6, new java.awt.GridBagConstraints());

        psJdrop.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Select Photo Set" }));
        psJdrop.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                popdrop(evt);
            }
        });
        psJdrop.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                popper(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 6;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        Editor1.add(psJdrop, gridBagConstraints);

        manage.setText("Manage Photo Sets");
        manage.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                managepopupManager(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 6;
        Editor1.add(manage, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 10;
        Editor1.add(jLabel1, gridBagConstraints);

        Top1.add(Editor1, new java.awt.GridBagConstraints());

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
        Content1.add(Top1, gridBagConstraints);

        descrlabel.setFont(new java.awt.Font("Tahoma", 1, 11));
        descrlabel.setText("Photo Description");

        descpane.setMinimumSize(new java.awt.Dimension(300, 300));
        descr.setColumns(20);
        descr.setRows(5);
        descpane.setViewportView(descr);

        javax.swing.GroupLayout Bottom1Layout = new javax.swing.GroupLayout(Bottom1);
        Bottom1.setLayout(Bottom1Layout);
        Bottom1Layout.setHorizontalGroup(
            Bottom1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(Bottom1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(Bottom1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(descpane, javax.swing.GroupLayout.DEFAULT_SIZE, 532, Short.MAX_VALUE)
                    .addComponent(descrlabel, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        Bottom1Layout.setVerticalGroup(
            Bottom1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(Bottom1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(descrlabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(descpane, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        Content1.add(Bottom1, gridBagConstraints);

        photoTab.add(Content1, java.awt.BorderLayout.WEST);

        jTabbedPanel.addTab("Photo Services", photoTab);
        photoTab.getAccessibleContext().setAccessibleName("photoTab");

        conversionTab.setLayout(new java.awt.BorderLayout());

        Title1.setLayout(new java.awt.BorderLayout());

        Title1.setBackground(new java.awt.Color(102, 102, 0));
        Title1.setMinimumSize(new java.awt.Dimension(531, 44));
        Title1.setPreferredSize(new java.awt.Dimension(531, 44));
        Text1.setBackground(new java.awt.Color(204, 255, 0));
        Text1.setFont(new java.awt.Font("Tahoma", 0, 36));
        Text1.setForeground(new java.awt.Color(255, 255, 255));
        Text1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        Text1.setText("Conversion Services");
        Text1.setFocusable(false);
        Title1.add(Text1, java.awt.BorderLayout.CENTER);

        conversionTab.add(Title1, java.awt.BorderLayout.NORTH);

        Content2.setLayout(new java.awt.GridBagLayout());

        Top2.setLayout(new java.awt.GridBagLayout());

        Editor2.setLayout(new java.awt.GridBagLayout());

        specs2.setFont(new java.awt.Font("Tahoma", 1, 12));
        specs2.setText("Conversion Specifications");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        Editor2.add(specs2, gridBagConstraints);

        Copies2.setText("1");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        Editor2.add(Copies2, gridBagConstraints);

        copies2.setText("Number of Items to Convert");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        Editor2.add(copies2, gridBagConstraints);

        typelabel2.setText("Conversion Type");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        Editor2.add(typelabel2, gridBagConstraints);

        convSerdrop.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Select Conversion Service" }));
        convSerdrop.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                findDiscount(evt);
            }
        });
        convSerdrop.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                populateCS(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        Editor2.add(convSerdrop, gridBagConstraints);

        sizelabel2.setText("Available Discount:");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        Editor2.add(sizelabel2, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        Editor2.add(jSeparator8, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        Editor2.add(jSeparator9, gridBagConstraints);

        jLabel10.setText("                                          ");
        Editor2.add(jLabel10, new java.awt.GridBagConstraints());

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 10;
        Editor2.add(jLabel3, gridBagConstraints);

        discount.setText("No Available Discount");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 4;
        Editor2.add(discount, gridBagConstraints);

        Top2.add(Editor2, new java.awt.GridBagConstraints());

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
        Content2.add(Top2, gridBagConstraints);

        descrlabel1.setFont(new java.awt.Font("Tahoma", 1, 11));
        descrlabel1.setText("Conversion Order Notes");

        descpane1.setMinimumSize(new java.awt.Dimension(300, 300));
        descr1.setColumns(20);
        descr1.setRows(5);
        descpane1.setViewportView(descr1);

        javax.swing.GroupLayout Bottom2Layout = new javax.swing.GroupLayout(Bottom2);
        Bottom2.setLayout(Bottom2Layout);
        Bottom2Layout.setHorizontalGroup(
            Bottom2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(Bottom2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(Bottom2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(descpane1, javax.swing.GroupLayout.DEFAULT_SIZE, 337, Short.MAX_VALUE)
                    .addComponent(descrlabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        Bottom2Layout.setVerticalGroup(
            Bottom2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(Bottom2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(descrlabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(descpane1, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
        Content2.add(Bottom2, gridBagConstraints);

        conversionTab.add(Content2, java.awt.BorderLayout.WEST);

        jTabbedPanel.addTab("Conversion", conversionTab);
        conversionTab.getAccessibleContext().setAccessibleName("conversionTab");

        bknNorth3.setLayout(new java.awt.BorderLayout());

        bknNorth3.setBackground(new java.awt.Color(255, 102, 102));
        bknNorth3.setForeground(new java.awt.Color(0, 102, 102));
        bknNorth3.setMinimumSize(new java.awt.Dimension(531, 44));
        bknNorth3.setPreferredSize(new java.awt.Dimension(531, 44));
        jLabel7.setBackground(new java.awt.Color(102, 0, 0));
        jLabel7.setFont(new java.awt.Font("Tahoma", 0, 36));
        jLabel7.setForeground(new java.awt.Color(255, 255, 255));
        jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel7.setText("Return Item");
        jLabel7.setFocusable(false);
        bknNorth3.add(jLabel7, java.awt.BorderLayout.NORTH);

        TransLabel.setText("TransactionID");

        Return_Label.setFont(new java.awt.Font("Tahoma", 1, 12));
        Return_Label.setText("Enter the Transaction ID to look up:");

        LookupTransaction_Button.setText("Lookup Transaction");
        LookupTransaction_Button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                LookupTransaction_ButtonActionPerformed(evt);
            }
        });

        jLabel4.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel4.setText("Old Transaction");

        jLabel5.setText("TransactionID");

        textArea_oldTXLines.setColumns(20);
        textArea_oldTXLines.setRows(5);
        jScrollPane1.setViewportView(textArea_oldTXLines);

        jLabel9.setText("Items to Return");

        jLabel11.setText("Return Quantity");

        javax.swing.GroupLayout returnTabLayout = new javax.swing.GroupLayout(returnTab);
        returnTab.setLayout(returnTabLayout);
        returnTabLayout.setHorizontalGroup(
            returnTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(returnTabLayout.createSequentialGroup()
                .addGap(174, 174, 174)
                .addComponent(Return_Label)
                .addContainerGap(147, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, returnTabLayout.createSequentialGroup()
                .addGap(14, 14, 14)
                .addComponent(bknNorth3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(returnTabLayout.createSequentialGroup()
                .addGap(69, 69, 69)
                .addComponent(TransLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(returnTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(LookupTransaction_Button)
                    .addComponent(field_TransID, javax.swing.GroupLayout.PREFERRED_SIZE, 355, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(50, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, returnTabLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jSeparator10, javax.swing.GroupLayout.DEFAULT_SIZE, 524, Short.MAX_VALUE)
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, returnTabLayout.createSequentialGroup()
                .addContainerGap(239, Short.MAX_VALUE)
                .addComponent(jLabel4)
                .addGap(210, 210, 210))
            .addGroup(returnTabLayout.createSequentialGroup()
                .addGap(64, 64, 64)
                .addGroup(returnTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel5)
                    .addComponent(jLabel9)
                    .addComponent(jLabel11))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(returnTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(field_ReturnQuantity, javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(field_OldTransactionID, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 358, Short.MAX_VALUE))
                .addContainerGap(41, Short.MAX_VALUE))
        );
        returnTabLayout.setVerticalGroup(
            returnTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(returnTabLayout.createSequentialGroup()
                .addComponent(bknNorth3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(Return_Label)
                .addGap(36, 36, 36)
                .addGroup(returnTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(field_TransID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TransLabel))
                .addGap(21, 21, 21)
                .addComponent(LookupTransaction_Button)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator10, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel4)
                .addGap(31, 31, 31)
                .addGroup(returnTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(field_OldTransactionID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(33, 33, 33)
                .addGroup(returnTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel9))
                .addGap(18, 18, 18)
                .addGroup(returnTabLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(field_ReturnQuantity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel11))
                .addContainerGap(31, Short.MAX_VALUE))
        );
        jTabbedPanel.addTab("Return Item", returnTab);
        returnTab.getAccessibleContext().setAccessibleName("returnTab");

        bknNorth4.setLayout(new java.awt.BorderLayout());

        bknNorth4.setBackground(new java.awt.Color(0, 102, 102));
        bknNorth4.setForeground(new java.awt.Color(0, 102, 102));
        bknNorth4.setMinimumSize(new java.awt.Dimension(531, 44));
        bknNorth4.setPreferredSize(new java.awt.Dimension(531, 44));
        label_svcTransactionLookup.setBackground(new java.awt.Color(102, 0, 0));
        label_svcTransactionLookup.setFont(new java.awt.Font("Tahoma", 0, 36));
        label_svcTransactionLookup.setForeground(new java.awt.Color(255, 255, 255));
        label_svcTransactionLookup.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        label_svcTransactionLookup.setText("Look Up Service Transaction");
        label_svcTransactionLookup.setFocusable(false);
        bknNorth4.add(label_svcTransactionLookup, java.awt.BorderLayout.NORTH);

        TransLabel1.setText("TransactionID");

        Return_Label1.setFont(new java.awt.Font("Tahoma", 1, 12));
        Return_Label1.setText("Enter the Transaction ID from the Reciept");

        button_lookupSvcTrans.setText("Lookup Transaction");
        button_lookupSvcTrans.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button_lookupSvcTransActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout SvcTransLookupLayout = new javax.swing.GroupLayout(SvcTransLookup);
        SvcTransLookup.setLayout(SvcTransLookupLayout);
        SvcTransLookupLayout.setHorizontalGroup(
            SvcTransLookupLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(SvcTransLookupLayout.createSequentialGroup()
                .addGap(140, 140, 140)
                .addComponent(Return_Label1)
                .addContainerGap(145, Short.MAX_VALUE))
            .addGroup(SvcTransLookupLayout.createSequentialGroup()
                .addGap(71, 71, 71)
                .addComponent(TransLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(SvcTransLookupLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(button_lookupSvcTrans)
                    .addComponent(svcTransField_id, javax.swing.GroupLayout.PREFERRED_SIZE, 355, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(47, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, SvcTransLookupLayout.createSequentialGroup()
                .addGap(14, 14, 14)
                .addGroup(SvcTransLookupLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jSeparator13, javax.swing.GroupLayout.DEFAULT_SIZE, 531, Short.MAX_VALUE)
                    .addGroup(SvcTransLookupLayout.createSequentialGroup()
                        .addComponent(jSeparator12, javax.swing.GroupLayout.DEFAULT_SIZE, 521, Short.MAX_VALUE)
                        .addContainerGap())
                    .addComponent(bknNorth4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );
        SvcTransLookupLayout.setVerticalGroup(
            SvcTransLookupLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(SvcTransLookupLayout.createSequentialGroup()
                .addComponent(bknNorth4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(Return_Label1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator12, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(20, 20, 20)
                .addGroup(SvcTransLookupLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(svcTransField_id, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(TransLabel1))
                .addGap(32, 32, 32)
                .addComponent(jSeparator13, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(21, 21, 21)
                .addComponent(button_lookupSvcTrans)
                .addContainerGap(250, Short.MAX_VALUE))
        );
        jTabbedPanel.addTab("Trans Lookup", SvcTransLookup);

        NightlyBatch.setLayout(new java.awt.GridBagLayout());

        NightlyBatch.setMaximumSize(new java.awt.Dimension(531, 32767));
        NightlyBatch.setMinimumSize(new java.awt.Dimension(531, 300));
        NightlyBatch.setPreferredSize(new java.awt.Dimension(531, 300));
        repNorth1.setLayout(new java.awt.BorderLayout());

        repNorth1.setMaximumSize(new java.awt.Dimension(531, 2147483647));
        repNorth1.setMinimumSize(new java.awt.Dimension(531, 100));
        repNorth1.setPreferredSize(new java.awt.Dimension(531, 100));
        repNorth1.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                repNorth1FocusGained(evt);
            }
        });

        repnNorth1.setLayout(new java.awt.BorderLayout());

        repnNorth1.setBackground(new java.awt.Color(102, 0, 0));
        repnNorth1.setMinimumSize(new java.awt.Dimension(531, 44));
        repnNorth1.setPreferredSize(new java.awt.Dimension(531, 44));
        label_repairItem1.setBackground(new java.awt.Color(102, 0, 0));
        label_repairItem1.setFont(new java.awt.Font("Tahoma", 0, 36));
        label_repairItem1.setForeground(new java.awt.Color(255, 255, 255));
        label_repairItem1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        label_repairItem1.setText("Nightly Batch");
        label_repairItem1.setFocusable(false);
        repnNorth1.add(label_repairItem1, java.awt.BorderLayout.CENTER);

        repNorth1.add(repnNorth1, java.awt.BorderLayout.NORTH);

        repnCenter1.setLayout(new java.awt.BorderLayout());

        repnCenter1.setMinimumSize(new java.awt.Dimension(531, 10));
        repnCenter1.setPreferredSize(new java.awt.Dimension(531, 10));
        label_enterRepInfo1.setFont(new java.awt.Font("Times New Roman", 1, 18));
        label_enterRepInfo1.setText("Click to run all batch processes:");
        repnCenter1.add(label_enterRepInfo1, java.awt.BorderLayout.CENTER);

        repNorth1.add(repnCenter1, java.awt.BorderLayout.CENTER);

        repnSouth1.setLayout(new java.awt.BorderLayout());

        repnSouth1.setMinimumSize(new java.awt.Dimension(531, 10));
        repnSouth1.setPreferredSize(new java.awt.Dimension(531, 10));
        repnSouth1.add(jSeparator4, java.awt.BorderLayout.CENTER);

        repNorth1.add(repnSouth1, java.awt.BorderLayout.SOUTH);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
        NightlyBatch.add(repNorth1, gridBagConstraints);

        repCenter1.setLayout(new java.awt.BorderLayout());

        repCenter1.setMaximumSize(new java.awt.Dimension(531, 100));
        repCenter1.setMinimumSize(new java.awt.Dimension(531, 100));
        repCenter1.setPreferredSize(new java.awt.Dimension(531, 100));
        label_lastNotice1.setMinimumSize(new java.awt.Dimension(125, 25));
        label_lastNotice1.setPreferredSize(new java.awt.Dimension(125, 25));
        repCenter1.add(label_lastNotice1, java.awt.BorderLayout.CENTER);

        jButton1.setText("Run Batch Processes");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        repCenter1.add(jButton1, java.awt.BorderLayout.NORTH);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        NightlyBatch.add(repCenter1, gridBagConstraints);

        repSouth1.setLayout(new java.awt.GridLayout(1, 0));

        repSouth1.setMaximumSize(new java.awt.Dimension(531, 2147483647));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 200, 0);
        NightlyBatch.add(repSouth1, gridBagConstraints);

        jTabbedPanel.addTab("Nightly Batch", NightlyBatch);

        panel_tabs.add(jTabbedPanel, java.awt.BorderLayout.NORTH);
        jTabbedPanel.getAccessibleContext().setAccessibleName("Home");

        panel_itemButtons.setLayout(new java.awt.GridBagLayout());

        button_addItem.setText("Add Item to Cart");
        button_addItem.addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentShown(java.awt.event.ComponentEvent evt) {
                button_addItemComponentShown(evt);
            }
        });
        button_addItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button_addItemActionPerformed(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        panel_itemButtons.add(button_addItem, gridBagConstraints);

        button_clearItem.setText("Clear Item");
        button_clearItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button_clearItemActionPerformed(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        panel_itemButtons.add(button_clearItem, gridBagConstraints);

        panel_tabs.add(panel_itemButtons, java.awt.BorderLayout.SOUTH);

        panel_allTxOps.add(panel_tabs);

        separator_txL_ops.setOrientation(javax.swing.SwingConstants.VERTICAL);
        panel_allTxOps.add(separator_txL_ops);

        panel_transLines.setLayout(new java.awt.BorderLayout(4, 4));

        jSeparator1.setOpaque(true);
        panel_transLines.add(jSeparator1, java.awt.BorderLayout.NORTH);

        label_transLine.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        label_transLine.setText("Transaction Lines:");
        label_transLine.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        panel_transLines.add(label_transLine, java.awt.BorderLayout.WEST);

        panel_listButtons.setLayout(new java.awt.GridBagLayout());

        jPanel2.setLayout(new java.awt.BorderLayout());

        scrollPane_txLineList.setMaximumSize(new java.awt.Dimension(453, 300));
        scrollPane_txLineList.setMinimumSize(new java.awt.Dimension(453, 300));
        scrollPane_txLineList.setPreferredSize(new java.awt.Dimension(453, 300));
        jTable_TxLineList.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jTable_TxLineList.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS);
        scrollPane_txLineList.setViewportView(jTable_TxLineList);

        jPanel2.add(scrollPane_txLineList, java.awt.BorderLayout.NORTH);

        panel_checkout.setLayout(new java.awt.BorderLayout());

        label_Checkout.setFont(new java.awt.Font("Times New Roman", 1, 18));
        label_Checkout.setText("Checkout Information:");
        label_Checkout.setMinimumSize(new java.awt.Dimension(140, 25));
        label_Checkout.setPreferredSize(new java.awt.Dimension(140, 25));
        panel_checkout.add(label_Checkout, java.awt.BorderLayout.NORTH);

        jPanel4.setLayout(new java.awt.GridBagLayout());

        field_pmtChange.setEditable(false);
        field_pmtChange.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        field_pmtChange.setText("0.00");
        field_pmtChange.setMinimumSize(new java.awt.Dimension(200, 25));
        field_pmtChange.setPreferredSize(new java.awt.Dimension(200, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanel4.add(field_pmtChange, gridBagConstraints);

        label_change.setText("Payment Change:");
        label_change.setMinimumSize(new java.awt.Dimension(200, 25));
        label_change.setPreferredSize(new java.awt.Dimension(200, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanel4.add(label_change, gridBagConstraints);

        label_paymentMethod.setText("Payment Method:");
        label_paymentMethod.setMinimumSize(new java.awt.Dimension(200, 25));
        label_paymentMethod.setPreferredSize(new java.awt.Dimension(200, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanel4.add(label_paymentMethod, gridBagConstraints);

        field_pmtAmount.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        field_pmtAmount.setText("0.00");
        field_pmtAmount.setMinimumSize(new java.awt.Dimension(200, 25));
        field_pmtAmount.setPreferredSize(new java.awt.Dimension(200, 25));
        field_pmtAmount.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                field_pmtAmountFocusGained(evt);
            }
            public void focusLost(java.awt.event.FocusEvent evt) {
                field_pmtAmountFocusLost(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanel4.add(field_pmtAmount, gridBagConstraints);

        cboBox_pmtMethod.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "<Select Payment Method>", "Check", "Credit Card", "Cash" }));
        cboBox_pmtMethod.setMinimumSize(new java.awt.Dimension(200, 25));
        cboBox_pmtMethod.setPreferredSize(new java.awt.Dimension(200, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanel4.add(cboBox_pmtMethod, gridBagConstraints);

        label_amount.setText("Payment Amount:");
        label_amount.setMinimumSize(new java.awt.Dimension(200, 25));
        label_amount.setPreferredSize(new java.awt.Dimension(200, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanel4.add(label_amount, gridBagConstraints);

        panel_checkout.add(jPanel4, java.awt.BorderLayout.CENTER);

        jSeparator11.setMinimumSize(new java.awt.Dimension(0, 10));
        jSeparator11.setPreferredSize(new java.awt.Dimension(0, 10));
        panel_checkout.add(jSeparator11, java.awt.BorderLayout.SOUTH);

        jPanel2.add(panel_checkout, java.awt.BorderLayout.CENTER);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        panel_listButtons.add(jPanel2, gridBagConstraints);

        panel_cancelSaveButtons.setLayout(new java.awt.GridBagLayout());

        panel_cancelSaveButtons.setMaximumSize(new java.awt.Dimension(453, 25));
        panel_cancelSaveButtons.setMinimumSize(new java.awt.Dimension(453, 25));
        panel_cancelSaveButtons.setPreferredSize(new java.awt.Dimension(453, 25));
        button_cancelTrans.setText("Cancel Tx");
        button_cancelTrans.setMaximumSize(new java.awt.Dimension(73, 23));
        button_cancelTrans.setMinimumSize(new java.awt.Dimension(73, 23));
        button_cancelTrans.setPreferredSize(new java.awt.Dimension(73, 23));
        button_cancelTrans.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button_cancelTransActionPerformed(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.ipadx = 6;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        panel_cancelSaveButtons.add(button_cancelTrans, gridBagConstraints);

        button_payTrans.setBackground(new java.awt.Color(153, 255, 153));
        button_payTrans.setText("Pay Now");
        button_payTrans.setMaximumSize(new java.awt.Dimension(65, 23));
        button_payTrans.setMinimumSize(new java.awt.Dimension(65, 23));
        button_payTrans.setPreferredSize(new java.awt.Dimension(65, 23));
        button_payTrans.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button_payTransActionPerformed(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.ipadx = 10;
        panel_cancelSaveButtons.add(button_payTrans, gridBagConstraints);

        button_applyCoupons.setText("Apply Coupons");
        button_applyCoupons.setMaximumSize(new java.awt.Dimension(105, 23));
        button_applyCoupons.setMinimumSize(new java.awt.Dimension(105, 23));
        button_applyCoupons.setPreferredSize(new java.awt.Dimension(105, 23));
        button_applyCoupons.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button_applyCouponsActionPerformed(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 3;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.ipadx = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        panel_cancelSaveButtons.add(button_applyCoupons, gridBagConstraints);

        button_deleteTxLine.setText("Delete Line");
        button_deleteTxLine.setMinimumSize(new java.awt.Dimension(85, 23));
        button_deleteTxLine.setPreferredSize(new java.awt.Dimension(85, 23));
        button_deleteTxLine.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button_deleteTxLineActionPerformed(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        panel_cancelSaveButtons.add(button_deleteTxLine, gridBagConstraints);

        button_savePendingTx.setText("Save Pending");
        button_savePendingTx.setPreferredSize(new java.awt.Dimension(97, 23));
        button_savePendingTx.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                button_savePendingTxActionPerformed(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 4;
        gridBagConstraints.gridy = 0;
        panel_cancelSaveButtons.add(button_savePendingTx, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        panel_listButtons.add(panel_cancelSaveButtons, gridBagConstraints);

        panel_listTotals.setLayout(new java.awt.BorderLayout());

        panel_totals.setLayout(new java.awt.GridBagLayout());

        label_subTotal.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        label_subTotal.setText("SubTotal:  $");
        label_subTotal.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        panel_totals.add(label_subTotal, gridBagConstraints);

        field_subTotal.setEditable(false);
        field_subTotal.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        field_subTotal.setText("0.00");
        field_subTotal.setMaximumSize(new java.awt.Dimension(2147483647, 25));
        field_subTotal.setMinimumSize(new java.awt.Dimension(4, 25));
        field_subTotal.setPreferredSize(new java.awt.Dimension(69, 25));
        panel_totals.add(field_subTotal, new java.awt.GridBagConstraints());

        label_tax.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        label_tax.setText("Tax:  $");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        panel_totals.add(label_tax, gridBagConstraints);

        field_tax.setEditable(false);
        field_tax.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        field_tax.setText("0.00");
        field_tax.setMaximumSize(new java.awt.Dimension(2147483647, 25));
        field_tax.setMinimumSize(new java.awt.Dimension(4, 25));
        field_tax.setPreferredSize(new java.awt.Dimension(69, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        panel_totals.add(field_tax, gridBagConstraints);

        label_total.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        label_total.setText("Total:  $");
        label_total.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        panel_totals.add(label_total, gridBagConstraints);

        field_total.setEditable(false);
        field_total.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        field_total.setText("0.00");
        field_total.setMaximumSize(new java.awt.Dimension(2147483647, 25));
        field_total.setMinimumSize(new java.awt.Dimension(4, 25));
        field_total.setPreferredSize(new java.awt.Dimension(69, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        panel_totals.add(field_total, gridBagConstraints);

        label_discount.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        label_discount.setText("Discount:  $");
        label_discount.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        panel_totals.add(label_discount, gridBagConstraints);

        field_discount.setEditable(false);
        field_discount.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
        field_discount.setText("0.00");
        field_discount.setMaximumSize(new java.awt.Dimension(2147483647, 25));
        field_discount.setMinimumSize(new java.awt.Dimension(4, 25));
        field_discount.setPreferredSize(new java.awt.Dimension(69, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 3;
        panel_totals.add(field_discount, gridBagConstraints);

        panel_listTotals.add(panel_totals, java.awt.BorderLayout.NORTH);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        panel_listButtons.add(panel_listTotals, gridBagConstraints);

        panel_transLines.add(panel_listButtons, java.awt.BorderLayout.SOUTH);

        panel_allTxOps.add(panel_transLines);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTH;
        getContentPane().add(panel_allTxOps, gridBagConstraints);

        pack();
    }// </editor-fold>//GEN-END:initComponents
    
    private void rentalCategories_cboItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_rentalCategories_cboItemStateChanged
        
//        RentalHandler rh = RentalHandler.getInstance();
//        rentalCategories_cbo.setModel(new javax.swing.DefaultComboBoxModel(rh.getRentalCategoriesArray()));
//        if(this.field_lookupRentalItem.getText().equals("<Enter Keyword>") || this.field_lookupRentalItem.getText().equals("")){
//            RentalItemList = rh.getAvailableItemsByCategory((String)this.rentalCategories_cbo.getSelectedItem());
//        }else{
//            RentalItemList = rh.lookupByKeyword((String)this.rentalCategories_cbo.getSelectedItem(),this.field_lookupRentalItem.getText());
//        }
//        ArrayList<String> itemNames = new ArrayList<String>();
//        for(int x=0; x<RentalItemList.size();x++){
//            itemNames.add(RentalItemList.get(x).getConceptual().getDescription());
//        }
//        this.rentalListb.setListData(rh.getInstance().getAllAvailableRentalProdDescriptions());
//        this.rentalList.updateUI();
//
//
        
        RentalHandler rh = RentalHandler.getInstance();
        if(this.field_lookupRentalItem.getText().equals("<Enter Keyword>") || this.field_lookupRentalItem.getText().equals("")){
            RentalItemList = rh.getAvailableItemsByCategory((String)this.rentalCategories_cbo.getSelectedItem());
        }else{
            RentalItemList = rh.lookupByKeyword((String)this.rentalCategories_cbo.getSelectedItem(),this.field_lookupRentalItem.getText());
        }
        ArrayList<String> itemNames = new ArrayList<String>();
        for(int x=0; x<RentalItemList.size();x++){
            itemNames.add(RentalItemList.get(x).getConceptual().getDescription());
        }
        this.rentalList.setListData(itemNames.toArray());
        this.rentalList.updateUI();// TODO add your handling code here:
    }//GEN-LAST:event_rentalCategories_cboItemStateChanged
    
    private void rentalCategories_cboPopupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent evt) {//GEN-FIRST:event_rentalCategories_cboPopupMenuWillBecomeVisible
// TODO add your handling code here:
    }//GEN-LAST:event_rentalCategories_cboPopupMenuWillBecomeVisible
    
    private void rentalCategories_cboPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_rentalCategories_cboPropertyChange
        
    }//GEN-LAST:event_rentalCategories_cboPropertyChange
    
    private void button_searchRentalsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button_searchRentalsActionPerformed
        RentalHandler rh = RentalHandler.getInstance();
        if(this.field_lookupRentalItem.getText().equals("<Enter Keyword>") || this.field_lookupRentalItem.getText().equals("")){
            RentalItemList = rh.getAvailableItemsByCategory((String)this.rentalCategories_cbo.getSelectedItem());
        }else{
            RentalItemList = rh.lookupByKeyword((String)this.rentalCategories_cbo.getSelectedItem(),this.field_lookupRentalItem.getText());
        }
        ArrayList<String> itemNames = new ArrayList<String>();
        for(int x=0; x<RentalItemList.size();x++){
            itemNames.add(RentalItemList.get(x).getConceptual().getDescription());
        }
        this.rentalList.setListData(itemNames.toArray());
        this.rentalList.updateUI();
    }//GEN-LAST:event_button_searchRentalsActionPerformed
    
    private void field_lookupRentalItemFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_field_lookupRentalItemFocusGained
        if(this.field_lookupRentalItem.getText().equals("<Enter Keyword>")){this.field_lookupRentalItem.setText("");}
    }//GEN-LAST:event_field_lookupRentalItemFocusGained
    
    private void rentalListValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_rentalListValueChanged
        int selection = rentalList.getSelectedIndex();
        ForRentBO frItem = RentalItemList.get(selection);
        ArrayList<String> info = RentalHandler.getInstance().populateRentalPanel(frItem);
        this.pricePerDay.setText(info.get(0));
        this.replacementPrice.setText(info.get(1));
        this.maxTimesRented.setText(info.get(2));
        this.lateFeePerDay.setText(info.get(3));
        this.sku.setText(info.get(4));
        this.productID.setText(info.get(5));
        this.description.setText(info.get(6));
        
        
    }//GEN-LAST:event_rentalListValueChanged
    
    private void field_lookupRentalItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_field_lookupRentalItemActionPerformed
// TODO add your handling code here:
    }//GEN-LAST:event_field_lookupRentalItemActionPerformed
    
    private void rentalCategories_cboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rentalCategories_cboActionPerformed
        
//// TODO add your handling code here:
    }//GEN-LAST:event_rentalCategories_cboActionPerformed
    
    private void jTextField2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField2ActionPerformed
// TODO add your handling code here:
    }//GEN-LAST:event_jTextField2ActionPerformed
    
    private void LookupTransaction_ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_LookupTransaction_ButtonActionPerformed
        ReturnHandler rHandler = ReturnHandler.getInstance();
        TransactionBO oldTX = null;
        
        try{
            oldTX = rHandler.lookupOldTransaction(this.field_TransID.getText());
        }catch(Exception e){
            e.printStackTrace();
        }
        
        this.field_OldTransactionID.setText(oldTX.getTransID());
        
        ArrayList<TransLineBO> oldTxList = oldTX.getTxLineList();
        SaleBO oldSale = null;
        ForSaleBO oldForSaleBO = null;
        
        for(int counter = 0; counter < oldTxList.size(); counter++){
            
            if(oldTxList.get(counter).getRevSrc().getType().equals("sale")){
                oldSale = (SaleBO)oldTxList.get(counter).getRevSrc();
                
                if(oldSale.getProduct().getProdType().equals("physical")){
                    oldForSaleBO = (ForSaleBO)oldSale.getProduct();
                    if(oldForSaleBO.getNewUsed()==true){
                        this.textArea_oldTXLines.append(oldSale.getProduct().getSKU() + "\n");
                    }//end if new Physical
                }//end if physical
                else if(oldSale.getProduct().getProdType().equals("conceptual")){
                    this.textArea_oldTXLines.append(oldSale.getProduct().getSKU() + "\n");
                }
            }//end catch for sales
        }//end loop for oldTxList
        
        
        
    }//GEN-LAST:event_LookupTransaction_ButtonActionPerformed
    
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        try {
            //run the backup and service batch files
            BackupBatch.getInstance().processBatch();
            SvcRepairBatch.getInstance().processBatch();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }//GEN-LAST:event_jButton1ActionPerformed
    
    /** This method is called when a transaction is saved that requires no payment, such
     *as a repair transaction.
     */
    private void button_savePendingTxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button_savePendingTxActionPerformed
        try {
            //finalize and post the pending transaction to the database
            String compDate = null, pickupDate = null, lastNoticeDate = null;
            if(!this.repField_completeDate.getText().equals("<date completed>") && !this.repField_completeDate.getText().equals("")){
                compDate = this.repField_completeDate.getText();
            }
            if(!this.repField_pickUp.getText().equals("<date completed>") && !this.repField_pickUp.getText().equals("")){
                compDate = this.repField_pickUp.getText();
            }
            if(!this.repField_lastNotice.getText().equals("<date completed>") && !this.repField_lastNotice.getText().equals("")){
                compDate = this.repField_lastNotice.getText();
            }
            
            if(this.tx.isAlreadyInDB()){
                this.tx.getTxLineList().get(0).setRevSrc(SvcRepairHandler.getInstance().updateSvcRepair((SvcRepairBO)this.tx.getTxLineList().get(0).getRevSrc(),
                        compDate, pickupDate,lastNoticeDate,this.repField_price.getText(),this.repField_laborHrs.getText()));
            }
            tx.setTransStatus("Pending");
            UpdateController.getInstance().post_sale(tx);
            
            //then refresh the screen
            this.field_custName.setText("<customer name>");
            this.field_transID.setText("<transaction id>");
            this.tx.setTxLineList(new ArrayList<TransLineBO>());
            ArrayList<TransLineBO> blank = new ArrayList<TransLineBO>();
            newModel.loadData(blank);
            this.jTable_TxLineList.updateUI();
            this.tx = null;
            this.cust = null;
            for(int i=0; i<=6;i++){
                this.jTabbedPanel.setSelectedIndex(i);
                clearData();
            }
            this.field_subTotal.setText("");
            this.field_tax.setText("");
            this.field_total.setText("");
            this.field_discount.setText("");
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }//GEN-LAST:event_button_savePendingTxActionPerformed
    
    private void field_pmtAmountFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_field_pmtAmountFocusLost
            this.field_pmtChange.setText(fmt.format(tx.calcChange(Double.parseDouble(this.field_pmtAmount.getText()))));
    }//GEN-LAST:event_field_pmtAmountFocusLost
    
    private void field_pmtAmountFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_field_pmtAmountFocusGained
        if(this.field_pmtAmount.getText().equals("0.00")){ this.field_pmtAmount.setText(""); }
    }//GEN-LAST:event_field_pmtAmountFocusGained
    
    private void button_lookupSvcTransActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button_lookupSvcTransActionPerformed
        try {
            TransactionBO newTx = TransactionDAO.getInstance().read(this.svcTransField_id.getText());
            this.tx = newTx;
            this.field_TransID.setText(tx.getTransID());
            this.field_custName.setText(tx.getCustomer().getCustFullName());
            this.field_subTotal.setText(Double.toString(tx.getTransSubTotal()));
            this.field_tax.setText(Double.toString(tx.getTransTax()));
            this.field_total.setText(Double.toString(tx.getTransTotal()));
            this.field_discount.setText(Double.toString(tx.getTotalDiscountTaken()));
            this.label_transStatus.setText(tx.getTransStatus());
            this.newModel.loadData(tx.getTxLineList());
            this.jTable_TxLineList.updateUI();
        } catch (ConnectionPoolException ex) {
            ex.printStackTrace();
        } catch (DataException ex) {
            ex.printStackTrace();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }//GEN-LAST:event_button_lookupSvcTransActionPerformed
    
    private void repNorth1FocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_repNorth1FocusGained
        
    }//GEN-LAST:event_repNorth1FocusGained
    
    private void jButton6popupManager(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6popupManager
        try {
            PhotoSetGUI psMan = new PhotoSetGUI();
            psMan.setVisible(true);
        } catch (SQLException ex) {
            ex.printStackTrace();
        } catch (DataException ex) {
            ex.printStackTrace();
        } catch (ConnectionPoolException ex) {
            ex.printStackTrace();
        }
    }//GEN-LAST:event_jButton6popupManager
    
    private void button_applyCouponsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button_applyCouponsActionPerformed
        this.tx.applyCoupons();
        this.tx.calcSubTotal();
        this.tx.calcTax();
        this.tx.calcTotal();
        this.field_subTotal.setText(fmt.format(this.tx.getTransSubTotal()));
        this.field_tax.setText(fmt.format(this.tx.getTransTax()));
        this.field_total.setText(fmt.format(this.tx.getTransTotal()));
    }//GEN-LAST:event_button_applyCouponsActionPerformed
    
    private void button_clearItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button_clearItemActionPerformed
        this.clearData();
    }//GEN-LAST:event_button_clearItemActionPerformed
    
    private void bkField_addSizeFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_bkField_addSizeFocusGained
        if(this.bkField_addSize.getText().equals("<size>")){ this.bkField_addSize.setText(""); }
    }//GEN-LAST:event_bkField_addSizeFocusGained
    
    private void repField_lastNoticeFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_repField_lastNoticeFocusGained
        if(this.repField_lastNotice.getText().equals("<last notice date>")){ this.repField_lastNotice.setText(""); }
    }//GEN-LAST:event_repField_lastNoticeFocusGained
    
    private void repField_pickUpFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_repField_pickUpFocusGained
        if(this.repField_pickUp.getText().equals("<pick up date>")){ this.repField_pickUp.setText(""); }
    }//GEN-LAST:event_repField_pickUpFocusGained
    
    private void repField_completeDateFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_repField_completeDateFocusGained
        if(this.repField_completeDate.getText().equals("<date completed>")){ this.repField_completeDate.setText(""); }
    }//GEN-LAST:event_repField_completeDateFocusGained
    
    private void repField_priceFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_repField_priceFocusGained
        if(this.repField_price.getText().equals("<price>")){ this.repField_price.setText(""); }
    }//GEN-LAST:event_repField_priceFocusGained
    
    private void repField_laborHrsFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_repField_laborHrsFocusGained
        if(this.repField_laborHrs.getText().equals("<labor hours>")){ this.repField_laborHrs.setText(""); }
    }//GEN-LAST:event_repField_laborHrsFocusGained
    
    private void repField_startDateFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_repField_startDateFocusGained
        if(this.repField_startDate.getText().equals("<start date>")){ this.repField_startDate.setText(""); }
    }//GEN-LAST:event_repField_startDateFocusGained
    
    private void repField_skuFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_repField_skuFocusGained
        if(this.repField_sku.getText().equals("<SKU>")){ this.repField_sku.setText(""); }
    }//GEN-LAST:event_repField_skuFocusGained
    
//******************************************************************************
//   jTabbedPane Action Performed (Someone clicked on a TAB)
//******************************************************************************
    private void jTabbedPanelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTabbedPanelMouseClicked
        try {
            //get the displayed tab
//            if(cust == null){   //make sure a customer is selected
//                JOptionPane.showMessageDialog(null, "Please select a customer first.");
//                return;
//            }
            int panelNum = this.jTabbedPanel.getSelectedIndex();
            switch (panelNum){
                case 0:     //Sales tab
                    break;
                case 1:     //Rental tab
                    
                    //      RentalHandler rh = RentalHandler.getInstance();
//                    String[] temp = new String[3];
//
//                    rentalCategories.setModel(new javax.swing.DefaultComboBoxModel(rh.getRentalCategoriesArray()));
//                    rentalCategories.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Digital Cameras", "Tripods", "Etc" }));
//                    rentalCategories.setModel(new javax.swing.DefaultComboBoxModel(temp));
                    
                    
                    
////                    ArrayList <ProductBO> list = ConceptualDAO.getInstance().readAll();
////                    // ConceptualDAO.getInstance().readAll()
////                    // ForRentDAO.getInstance().readAll();
////                    ArrayList<String> categoryList = new ArrayList<String>();
////                    for (int i = 0; i < list.size(); i++) {
////                        //ForRentBO frbo = ((ForRentBO)PhysicalDAO.getInstance().read(list.get(i).getProductID())).getConceptual().getCategory();
////                        ForRentBO p = (ForRentBO)list.get(i);
////                        categoryList.add(((ForRentBO)PhysicalDAO.getInstance().read(list.get(i).getProductID())).getConceptual().getCategory());
////                        categoryList.add(p.getSKU());
////                    }
                    // itemsForRentList.addListSelectionListener(categoryList.to toCharArray());
                    break;
                case 2:     //Backup tab
                    if(cust.getCustMembership() == null){ //make sure the customer has a valid membership
                        JOptionPane.showMessageDialog(null, "This customer is not a member.  Membership is required to have the " +
                                "backup service.  \nPlease create the new membership and return to this point.");
                        return;
                    }else{
                        try {
                            this.label_memberID.setText(this.cust.getCustMembership().getMembershipID());   //set the membership id
                            this.label_memberName.setText(this.cust.getCustFullName());                     //set the member name
                            this.label_backupSize.setText(Double.toString(this.cust.getCustMembership().getBuSize()) + "GB");   //set the existing backup size
                            //get today's date for cost calculation
                            Calendar cal = Calendar.getInstance();
                            Date today = cal.getTime();
                            SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
                            String todayDate = fmt.format(today);
                            //calculate the cost for 6 months and display
                            this.label_currentCost.setText("$" + Double.toString(BackupHandler.getInstance().calcPrice(
                                    this.cust.getCustMembership().getBuSize(), BackupHandler.getInstance().addNewPeriod(todayDate))));
                            if(this.cust.getCustMembership().getBuExpDate() != null){
                                this.label_currentExpDate.setText(this.cust.getCustMembership().getBuExpDate());
                            }else{
                                this.label_currentExpDate.setText("No current backup service.");
                            }
                        } catch (Exception ex) {
                            ex.printStackTrace();
                        }
                    }
                    break;
                case 3:     //Repair tab
                    break;
                case 4:     //Prints tab
                    break;
                case 5:      //Conversion tab
                    break;
                case 6:      //return item tab
                    break;
                default:     //no tab selected
                    break;
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        
    }//GEN-LAST:event_jTabbedPanelMouseClicked
    
    /** Method called when the backupTab is displayed that sets all of the user information.
     *@param evt contains the event that the panel has been displayed
     */
    private void backupTabFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_backupTabFocusGained
        
    }//GEN-LAST:event_backupTabFocusGained
    
    private void jTabbedPanelMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTabbedPanelMouseEntered
// TODO add your handling code here:
    }//GEN-LAST:event_jTabbedPanelMouseEntered
    
    private void bkField_addSizeFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_bkField_addSizeFocusLost
        try {
            String expDate = this.cust.getCustMembership().getBuExpDate();
            if(expDate == null){
                //get today's date for the begin date
                Calendar cal = Calendar.getInstance();
                Date today = cal.getTime();
                SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
                String todayDate = fmt.format(today);
                
                expDate = BackupHandler.getInstance().addNewPeriod(todayDate);
            }
            this.bkField_addCost.setText(fmt.format(BackupHandler.getInstance().calcPrice(Double.parseDouble(this.bkField_addSize.getText()),expDate)));
        } catch (NumberFormatException ex) {
            ex.printStackTrace();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }//GEN-LAST:event_bkField_addSizeFocusLost
    
    private void repField_skuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_repField_skuActionPerformed
// TODO add your handling code here:
    }//GEN-LAST:event_repField_skuActionPerformed
    
    private void popPrint(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_popPrint
        
    }//GEN-LAST:event_popPrint
    
    /** Sets the customer object for this frame.
     *@param cust contains the customerBO for this transaction.
     */
    public void setCust(CustomerBO cust){
        this.cust = cust;
    }
    
    /** Creates a new transaction (called after the customer has been selected)
     */
    public void createNewTransaction(){
        try {
            tx = TransactionDAO.getInstance().create();
            tx.setCustomerID(this.cust.getCustID());
            tx.setSession(this.getSession());
            //get today's date for the transaction date
            Calendar cal = Calendar.getInstance();
            Date today = cal.getTime();
            SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
            String todayDate = fmt.format(today);
            this.tx.setTransDate(todayDate);
            this.field_transID.setText(tx.getTransID());
            this.label_transStatus.setText(tx.getTransStatus());
            this.field_pmtAmount.setEditable(true);
            this.cboBox_pmtMethod.setEnabled(true);
            this.field_pmtChange.setEditable(true);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    
    public Session getSession(){
        Session s = null;
        try {
            if(this.session != null){
                s = this.session;
            }else{
                s = Session.create(EmployeeDAO.getInstance().readByUserName("rcluff"),
                        StoreDAO.getInstance().read("0000011106a3cc370000007f000002"));
            }
        } catch (SQLException ex) {
            ex.printStackTrace();
        } catch (DataException ex) {
            ex.printStackTrace();
        } catch (ConnectionPoolException ex) {
            ex.printStackTrace();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return s;
    }
    private void repField_lastNoticeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_repField_lastNoticeActionPerformed
// TODO add your handling code here:
    }//GEN-LAST:event_repField_lastNoticeActionPerformed
    
    private void bkNorthFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_bkNorthFocusGained
// TODO add your handling code here:
    }//GEN-LAST:event_bkNorthFocusGained
    
    private void button_addItemComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_button_addItemComponentShown
// TODO add your handling code here:
    }//GEN-LAST:event_button_addItemComponentShown
    
    private void repNorthFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_repNorthFocusGained
// TODO add your handling code here:
    }//GEN-LAST:event_repNorthFocusGained
    
    private void bkNorth6FocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_bkNorth6FocusGained
// TODO add your handling code here:
    }//GEN-LAST:event_bkNorth6FocusGained
    
    private void bkNorth2FocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_bkNorth2FocusGained
// TODO add your handling code here:
    }//GEN-LAST:event_bkNorth2FocusGained
    
    private void button_addItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button_addItemActionPerformed
        int panelNum = this.jTabbedPanel.getSelectedIndex();
        
        try {
            TransLineBO txL = TransLineDAO.getInstance().create();
            
            //get the displayed tab
            RevenueSourceBO rs = null;
//        System.out.println("Panel name: " + panelNum);
            switch (panelNum){
                case 0:     //Sale tab
                    rs = SaleHandler.getInstance().addProductToSale(this.field_SKU.getText(), Integer.parseInt(this.field_Qty.getText()));
                    txL.setTypeRS("sale");
                    break;
                case 1:     //Rental tab
                    if(this.dateOut.getText().equals("") || this.dateDue.getText().equals("")){
                        JOptionPane.showMessageDialog(null,"Please complete all fields.");
                        return;
                    }
                    ArrayList<String> input = new ArrayList<String>();
                    input.add(this.dateOut.getText());
                    input.add(this.dateDue.getText());
                    input.add(this.pricePerDay.getText());
                    input.add(this.replacementPrice.getText());
                    input.add(this.maxTimesRented.getText());
                    input.add(this.lateFeePerDay.getText());
                    input.add(this.sku.getText());
                    input.add(this.productID.getText());
                    input.add(this.description.getText());
                    rs = RentalHandler.getInstance().processNewRental(input);
                    txL.setTypeRS("rental");
                    break;
                case 2:     //Backup tab
                    rs = BackupHandler.getInstance().addNewBackup(this.cust.getCustMembership().getMembershipID(),this.bkField_addSize.getText());
                    txL.setTypeRS("backup");
                    break;
                case 3:     //Repair tab
                    String nullitem = null;
                    rs = SvcRepairHandler.getInstance().newSvcRepair(this.repField_sku.getText(),nullitem,this.cust.getCustID(),
                            (String)this.repCboBox_contactMethod.getSelectedItem(),this.repField_laborHrs.getText(),this.repField_price.getText(),
                            this.session.getEmployee().getEmployeeID());
                    txL.setTypeRS("repair");
                    break;
                case 4:     //Prints tab
                    txL.setTypeRS("print");
                    break;
                case 5:      //Conversion tab
                    txL.setTypeRS("conversion");
                    break;
                case 6:      //return item tab
                    rs = ReturnHandler.getInstance().MakeReturnRevenueSource(this.textArea_oldTXLines.getSelectedText(), Integer.parseInt(this.field_ReturnQuantity.getText()));
                    txL.setTypeRS("return");
                    break;
                default:     //no tab selected
                    break;
            }
            //create the transaction line
            if(rs == null){
                JOptionPane.showMessageDialog(null,"An error occurred saving the current operation.");
            }else{
                //create and populate the new transaction line
                txL.setRevSrc(rs);                                      //use the revenue source created from above
                txL.setTransactionID(this.tx.getTransID());
                txL.calcLineAmount();
                tx.addTxLine(txL);      //add the transaction line to the transaction
//                for(int h=0; h<tx.getTxLineList().size();h++){
//                    System.out.println("TxLine: " + tx.getTxLineList().get(h).getRevSrc().getDescription());
//                }
                calcTotals();
            }
            this.newModel.loadData(tx.getTxLineList());
            this.jTable_TxLineList.updateUI();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        
    }//GEN-LAST:event_button_addItemActionPerformed
    
    private void phoneLabel4changeBackColor(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_phoneLabel4changeBackColor
//phoneLabel.setBackground("232, 223, 122");
    }//GEN-LAST:event_phoneLabel4changeBackColor
    
    private void CreateCustBttn4createCustBtn(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CreateCustBttn4createCustBtn
        
    }//GEN-LAST:event_CreateCustBttn4createCustBtn
    
    private void phoneLabel3changeBackColor(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_phoneLabel3changeBackColor
//phoneLabel.setBackground("232, 223, 122");
    }//GEN-LAST:event_phoneLabel3changeBackColor
    
    private void CreateCustBttn3createCustBtn(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CreateCustBttn3createCustBtn
        
    }//GEN-LAST:event_CreateCustBttn3createCustBtn
    
    private void phoneLabel2changeBackColor(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_phoneLabel2changeBackColor
//phoneLabel.setBackground("232, 223, 122");
    }//GEN-LAST:event_phoneLabel2changeBackColor
    
    private void CreateCustBttn2createCustBtn(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CreateCustBttn2createCustBtn
        
    }//GEN-LAST:event_CreateCustBttn2createCustBtn
    
    private void phoneLabel1changeBackColor(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_phoneLabel1changeBackColor
//phoneLabel.setBackground("232, 223, 122");
    }//GEN-LAST:event_phoneLabel1changeBackColor
    
    private void CreateCustBttn1createCustBtn(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CreateCustBttn1createCustBtn
        
    }//GEN-LAST:event_CreateCustBttn1createCustBtn
    
    private void phoneLabelchangeBackColor(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_phoneLabelchangeBackColor
//phoneLabel.setBackground("232, 223, 122");
    }//GEN-LAST:event_phoneLabelchangeBackColor
    
    private void CreateCustBttncreateCustBtn(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CreateCustBttncreateCustBtn
        
    }//GEN-LAST:event_CreateCustBttncreateCustBtn
    
    private void button_payTransActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button_payTransActionPerformed
        if((this.cboBox_pmtMethod.getSelectedIndex() == 0) || this.field_pmtAmount.getText().equals("<amount>")) {
            JOptionPane.showMessageDialog(null,"Please enter payment information.");
        }
        double chg = tx.calcChange(Double.parseDouble(this.field_pmtAmount.getText()));
        try {
            tx.setPmt(PaymentHandler.getInstance().makePayment(this.field_pmtAmount.getText(),(String)this.cboBox_pmtMethod.getSelectedItem(),Double.toString(chg)));
        } catch(Exception ex){
            JOptionPane.showMessageDialog(null,"An error occurred when processing payment.");
        }
        //finalize and post the transaction to the database
        tx.setTransStatus("Complete");
        UpdateController.getInstance().post_sale(tx);
        
        //then refresh the screen
        this.field_custName.setText("<customer name>");
        this.field_transID.setText("<transaction id>");
        this.field_pmtAmount.setText("0.00");
        this.field_pmtChange.setText("0.00");
        this.tx.setTxLineList(new ArrayList<TransLineBO>());
        ArrayList<TransLineBO> blank = new ArrayList<TransLineBO>();
        newModel.loadData(blank);
        this.jTable_TxLineList.updateUI();
        this.tx = null;
        this.cust = null;
        for(int i=0; i<=6;i++){
            this.jTabbedPanel.setSelectedIndex(i);
            clearData();
        }
        this.field_subTotal.setText("0.00");
        this.field_tax.setText("0.00");
        this.field_total.setText("0.00");
        this.field_discount.setText("0.00");
    }//GEN-LAST:event_button_payTransActionPerformed
    
    private void button_manageCustActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_button_manageCustActionPerformed
        try {                                                           //change appearance according to system
            String look = UIManager.getSystemLookAndFeelClassName();
            UIManager.setLookAndFeel(look);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        CustomerFrame custFrame = new CustomerFrame(this);                           //initialize frame
        custFrame.setLocationRelativeTo(null);                                       //set frame location to center of screen
        custFrame.setVisible(true);                                                  //display frame
        custFrame.addWindowListener(new CustomerListener(this, custFrame));
        System.out.println("The window is closed.");
//        System.out.println(cust.getCustFullName());
//        this.field_custName.setText(cust.getCustFullName());
    }//GEN-LAST:event_button_manageCustActionPerformed
    
//    private void jTextArea2AncestorAdded(AncestorEvent evt){}
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new MainFrame().setVisible(true);
            }
        });
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel Bottom1;
    private javax.swing.JPanel Bottom2;
    private javax.swing.JPanel Content1;
    private javax.swing.JPanel Content2;
    private javax.swing.JTextField Copies1;
    private javax.swing.JTextField Copies2;
    private javax.swing.JPanel Editor1;
    private javax.swing.JPanel Editor2;
    private javax.swing.JPanel Editor3;
    private javax.swing.JLabel EnterSKULabel;
    private javax.swing.JButton LookupTransaction_Button;
    private javax.swing.JPanel NightlyBatch;
    private javax.swing.JLabel PhotoSetSelect1;
    private javax.swing.JLabel QtyLabel;
    private javax.swing.JPanel RentalDescription;
    private javax.swing.JPanel RentalInfoFields;
    private javax.swing.JPanel RentalPane;
    private javax.swing.JLabel Return_Label;
    private javax.swing.JLabel Return_Label1;
    private javax.swing.JLabel SKULabel;
    private javax.swing.JPanel SvcTransLookup;
    private javax.swing.JLabel Text;
    private javax.swing.JLabel Text1;
    private javax.swing.JLabel Text2;
    private javax.swing.JPanel Title;
    private javax.swing.JPanel Title1;
    private javax.swing.JPanel Title2;
    private javax.swing.JPanel Top1;
    private javax.swing.JPanel Top2;
    private javax.swing.JLabel TransLabel;
    private javax.swing.JLabel TransLabel1;
    private javax.swing.JPanel backupTab;
    private javax.swing.JTextField batchenter1;
    private javax.swing.JLabel batchlabel1;
    private javax.swing.JPanel bkCenter;
    private javax.swing.JPanel bkCenter6;
    private javax.swing.JTextField bkField_addCost;
    private javax.swing.JTextField bkField_addSize;
    private javax.swing.JLabel bkLabel_curExpDate;
    private javax.swing.JPanel bkNorth;
    private javax.swing.JPanel bkNorth6;
    private javax.swing.JPanel bknNorth3;
    private javax.swing.JPanel bknNorth4;
    private javax.swing.JPanel bknNorth6;
    private javax.swing.JButton button_addItem;
    private javax.swing.JButton button_applyCoupons;
    private javax.swing.JButton button_cancelTrans;
    private javax.swing.JButton button_clearItem;
    private javax.swing.JButton button_deleteTxLine;
    private javax.swing.JButton button_lookupSvcTrans;
    private javax.swing.JButton button_manageCust;
    private javax.swing.JButton button_payTrans;
    private javax.swing.JButton button_savePendingTx;
    private javax.swing.JButton button_searchRentals;
    private javax.swing.JComboBox cboBox_pmtMethod;
    private javax.swing.JComboBox convSerdrop;
    private javax.swing.JPanel conversionTab;
    private javax.swing.JLabel copies1;
    private javax.swing.JLabel copies2;
    private javax.swing.JTextField dateDue;
    private javax.swing.JTextField dateOut;
    private javax.swing.JLabel dateOutr;
    private javax.swing.JScrollPane descpane;
    private javax.swing.JScrollPane descpane1;
    private javax.swing.JScrollPane descpane2;
    private javax.swing.JTextArea descr;
    private javax.swing.JTextArea descr1;
    private javax.swing.JTextArea description;
    private javax.swing.JLabel descrlabel;
    private javax.swing.JLabel descrlabel1;
    private javax.swing.JLabel descrlabel2;
    private javax.swing.JLabel discount;
    private javax.swing.JTextField field_OldTransactionID;
    private javax.swing.JTextField field_Qty;
    private javax.swing.JTextField field_ReturnQuantity;
    private javax.swing.JTextField field_SKU;
    private javax.swing.JTextField field_TransID;
    private javax.swing.JTextField field_custName;
    private javax.swing.JTextField field_discount;
    private javax.swing.JTextField field_lookupRentalItem;
    private javax.swing.JTextField field_pmtAmount;
    private javax.swing.JTextField field_pmtChange;
    private javax.swing.JTextField field_subTotal;
    private javax.swing.JTextField field_tax;
    private javax.swing.JTextField field_total;
    private javax.swing.JTextField field_transID;
    private javax.swing.JLabel format1;
    private javax.swing.JComboBox formatselect1;
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator10;
    private javax.swing.JSeparator jSeparator11;
    private javax.swing.JSeparator jSeparator12;
    private javax.swing.JSeparator jSeparator13;
    private javax.swing.JSeparator jSeparator14;
    private javax.swing.JSeparator jSeparator15;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JSeparator jSeparator4;
    private javax.swing.JSeparator jSeparator6;
    private javax.swing.JSeparator jSeparator7;
    private javax.swing.JSeparator jSeparator8;
    private javax.swing.JSeparator jSeparator9;
    private javax.swing.JSeparator jSeparator_left1;
    private javax.swing.JSeparator jSeparator_right1;
    private javax.swing.JTabbedPane jTabbedPanel;
    private javax.swing.JTable jTable_TxLineList;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JLabel label_Checkout;
    private javax.swing.JLabel label_MyStuffIcon;
    private javax.swing.JLabel label_MyStuffStoreFront;
    private javax.swing.JLabel label_SKU;
    private javax.swing.JLabel label_addBackup;
    private javax.swing.JLabel label_addCost;
    private javax.swing.JLabel label_addSpaceGB;
    private javax.swing.JLabel label_amount;
    private javax.swing.JLabel label_backupSize;
    private javax.swing.JLabel label_buSize;
    private javax.swing.JLabel label_change;
    private javax.swing.JLabel label_contactMethod;
    private javax.swing.JLabel label_curCost;
    private javax.swing.JLabel label_currentCost;
    private javax.swing.JLabel label_currentExpDate;
    private javax.swing.JLabel label_custName;
    private javax.swing.JLabel label_dateComplete;
    private javax.swing.JLabel label_description;
    private javax.swing.JLabel label_discount;
    private javax.swing.JLabel label_emp;
    private javax.swing.JLabel label_empName;
    private javax.swing.JLabel label_enterRepInfo;
    private javax.swing.JLabel label_enterRepInfo1;
    private javax.swing.JLabel label_existingBackup;
    private javax.swing.JLabel label_id;
    private javax.swing.JLabel label_lastNotice;
    private javax.swing.JLabel label_lastNotice1;
    private javax.swing.JLabel label_lbrHrs;
    private javax.swing.JLabel label_memberID;
    private javax.swing.JLabel label_memberName;
    private javax.swing.JLabel label_name;
    private javax.swing.JLabel label_paymentMethod;
    private javax.swing.JLabel label_pickUp;
    private javax.swing.JLabel label_price;
    private javax.swing.JLabel label_repairItem;
    private javax.swing.JLabel label_repairItem1;
    private javax.swing.JLabel label_startDate;
    private javax.swing.JLabel label_store;
    private javax.swing.JLabel label_storeAddress;
    private javax.swing.JLabel label_subTotal;
    private javax.swing.JLabel label_svcTransactionLookup;
    private javax.swing.JLabel label_tax;
    private javax.swing.JLabel label_total;
    private javax.swing.JLabel label_transID;
    private javax.swing.JLabel label_transLine;
    private javax.swing.JLabel label_transStatus;
    private javax.swing.JTextField lateFeePerDay;
    private javax.swing.JPanel leftPanel;
    private javax.swing.JButton manage;
    private javax.swing.JTextField maxTimesRented;
    private javax.swing.JPanel panel_North;
    private javax.swing.JPanel panel_TxInfo;
    private javax.swing.JPanel panel_addBackup;
    private javax.swing.JPanel panel_allTxOps;
    private javax.swing.JPanel panel_backup;
    private javax.swing.JPanel panel_cancelSaveButtons;
    private javax.swing.JPanel panel_checkout;
    private javax.swing.JPanel panel_itemButtons;
    private javax.swing.JPanel panel_listButtons;
    private javax.swing.JPanel panel_listTotals;
    private javax.swing.JPanel panel_tabs;
    private javax.swing.JPanel panel_totals;
    private javax.swing.JPanel panel_transLines;
    private javax.swing.JPanel photoTab;
    private javax.swing.JTextField pricePerDay;
    private javax.swing.JTextField productID;
    private javax.swing.JComboBox psJdrop;
    private javax.swing.JComboBox rentalCategories_cbo;
    private javax.swing.JList rentalList;
    private javax.swing.JScrollPane rentalScrollPane;
    private javax.swing.JPanel rentalTab;
    private javax.swing.JComboBox repCboBox_contactMethod;
    private javax.swing.JPanel repCenter;
    private javax.swing.JPanel repCenter1;
    private javax.swing.JTextField repField_completeDate;
    private javax.swing.JTextField repField_laborHrs;
    private javax.swing.JTextField repField_lastNotice;
    private javax.swing.JTextField repField_pickUp;
    private javax.swing.JTextField repField_price;
    private javax.swing.JTextField repField_sku;
    private javax.swing.JTextField repField_startDate;
    private javax.swing.JPanel repNorth;
    private javax.swing.JPanel repNorth1;
    private javax.swing.JPanel repSouth;
    private javax.swing.JPanel repSouth1;
    private javax.swing.JTextArea repTxtArea_description;
    private javax.swing.JPanel repairTab;
    private javax.swing.JTextField replacementPrice;
    private javax.swing.JPanel repnCenter;
    private javax.swing.JPanel repnCenter1;
    private javax.swing.JPanel repnNorth;
    private javax.swing.JPanel repnNorth1;
    private javax.swing.JPanel repnSouth;
    private javax.swing.JPanel repnSouth1;
    private javax.swing.JPanel repsNorth;
    private javax.swing.JPanel returnTab;
    private javax.swing.JPanel rightPanel;
    private javax.swing.JPanel saleTab;
    private javax.swing.JScrollPane scrollPane_txLineList;
    private javax.swing.JSeparator separator_txL_ops;
    private javax.swing.JLabel sizelabel1;
    private javax.swing.JLabel sizelabel2;
    private javax.swing.JLabel sizelabel3;
    private javax.swing.JComboBox sizeselect1;
    private javax.swing.JTextField sku;
    private javax.swing.JLabel specs1;
    private javax.swing.JLabel specs2;
    private javax.swing.JLabel specs3;
    private javax.swing.JTextField svcTransField_id;
    private javax.swing.JTextArea textArea_oldTXLines;
    private javax.swing.JLabel typelabel1;
    private javax.swing.JLabel typelabel2;
    private javax.swing.JLabel typelabel3;
    private javax.swing.JComboBox typeselect1;
    // End of variables declaration//GEN-END:variables
    
    public class CustomerListener implements WindowListener {
        
        MainFrame MF = null;
        CustomerFrame CF = null;
        
        CustomerListener(MainFrame mf, CustomerFrame cf){
            this.MF = mf;
            this.CF = cf;
        }
        
        public void windowClosing(WindowEvent e) {
            System.out.println("Window closing");
        }
        
        public void windowClosed(WindowEvent e) {
            MF.setCust(CF.cust);
            MF.field_custName.setText(CF.cust.getCustFullName());
            System.out.println("Window closed");
            MF.createNewTransaction();
        }
        
        public void windowOpened(WindowEvent e) {
            System.out.println("Window opened");
        }
        
        public void windowIconified(WindowEvent e) {
            System.out.println("Window iconified");
        }
        
        public void windowDeiconified(WindowEvent e) {
            System.out.println("Window deiconified");
        }
        
        public void windowActivated(WindowEvent e) {
            System.out.println("Window activated");
        }
        
        public void windowDeactivated(WindowEvent e) {
            System.out.println("Window deactivated");
        }
    }
    
    private void popdrop(java.awt.event.MouseEvent evt) {
        System.out.println("GOIN HERE");
        try {
            
            psJdrop.setModel(new javax.swing.DefaultComboBoxModel(ph.getPSDesc()));
        } catch (SQLException ex) {
            ex.printStackTrace();
        } catch (ConnectionPoolException ex) {
            ex.printStackTrace();
        } catch (DataException ex) {
            ex.printStackTrace();
        }
        
    }
    
    private void popper(java.awt.event.FocusEvent evt) {
        try {
            
            psJdrop.setModel(new javax.swing.DefaultComboBoxModel(ph.getPSDesc()));
        } catch (SQLException ex) {
            ex.printStackTrace();
        } catch (ConnectionPoolException ex) {
            ex.printStackTrace();
        } catch (DataException ex) {
            ex.printStackTrace();
        }// TODO add your handling code here:
    }
    
    private void managepopupManager(java.awt.event.ActionEvent evt) {
        try {
            PhotoSetGUI psMan = new PhotoSetGUI();
            psMan.setVisible(true);
        } catch (SQLException ex) {
            ex.printStackTrace();
        } catch (DataException ex) {
            ex.printStackTrace();
        } catch (ConnectionPoolException ex) {
            ex.printStackTrace();
        }
    }
    
    private void findDiscount(java.awt.event.ActionEvent evt) {
        try {
            
            //  ch.addDiscount(10, 0.15, "00000111b5e1fbe900000005000011");
            //  ch.addDiscount(25, 0.30, "00000111b5e1fbf100000005000011");
            String dsct;
            DiscountBO dBO = (DiscountBO)ch.findDiscount(this.convSerdrop.getSelectedIndex());
            if (dBO != null){
                dsct = (dBO.getPercent()*100)+"% off "+dBO.getQuantity()+" items";
            }else{
                dsct = "No Discount Available";
            }
            discount.setText(dsct);
        } catch (Exception ex) {        }
        
    }
    
    private void populateCS(java.awt.event.FocusEvent evt) {
        try {
            convSerdrop.setModel(new javax.swing.DefaultComboBoxModel(ch.getCSDesc()));
        } catch (SQLException ex) {
            ex.printStackTrace();
        } catch (ConnectionPoolException ex) {
            ex.printStackTrace();
        } catch (DataException ex) {
            ex.printStackTrace();
        }catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    
//////    private void populateRDDM(java.awt.event.FocusEvent evt) throws SQLException, ConnectionPoolException, DataException {
//////        try {
//////            rentalList.setModel(new javax.swing.DefaultComboBoxModel(rh.getRentalCategoriesArray()));
//////        } catch (SQLException ex) {
//////            ex.printStackTrace();
//////        } catch (ConnectionPoolException ex) {
//////            ex.printStackTrace();
//////        } catch (DataException ex) {
//////            ex.printStackTrace();
//////        }catch (Exception ex) {
//////            ex.printStackTrace();
//////        }
//////    }
    
    private void button_cancelTransActionPerformed(java.awt.event.ActionEvent evt) {
        if(JOptionPane.showConfirmDialog(null,"Are you sure you want to cancel this transaction?",
                "Confirm Cancel",JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION){
            this.field_custName.setText("<customer name>");
            this.field_transID.setText("<transaction id>");
            this.tx.setTxLineList(new ArrayList<TransLineBO>());
            newModel.loadData(tx.getTxLineList());
            this.jTable_TxLineList.updateUI();
            this.tx = null;
            this.cust = null;
            for(int i=0; i<=6;i++){
                this.jTabbedPanel.setSelectedIndex(i);
                clearData();
            }
            this.field_subTotal.setText("");
            this.field_tax.setText("");
            this.field_total.setText("");
            this.field_discount.setText("");
            
        }else{
            return;
        }
    }
    
    private void field_SKUFocusGained(java.awt.event.FocusEvent evt) {
        if(this.field_SKU.getText().equals("<SKU>")){ this.field_SKU.setText(""); }
    }
    
    private void button_deleteTxLineActionPerformed(java.awt.event.ActionEvent evt) {
        int selection = this.jTable_TxLineList.getSelectedRow();
        if(selection == -1){
            JOptionPane.showMessageDialog(null,"Please select a row to be deleted.");
        }else{
            if(JOptionPane.showConfirmDialog(null,"Are you sure you want to delete this line?",
                    "Confirm Delete",JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION){
                tx.getTxLineList().remove(selection);
                newModel.loadData(tx.getTxLineList());
                this.clearData();
                this.jTable_TxLineList.updateUI();
                this.calcTotals();
                prevSelectedRow = -1;
            }
        }
        this.jTable_TxLineList.clearSelection();
    }
    /** Calculates and displays the totals in the frame.
     */
    public void calcTotals(){
        this.tx.applyCoupons();
        this.tx.calcSubTotal();
        this.tx.calcTax();
        this.tx.calcTotal();
        this.field_subTotal.setText(fmt.format(this.tx.getTransSubTotal()));
        this.field_tax.setText(fmt.format(this.tx.getTransTax()));
        this.field_total.setText(fmt.format(this.tx.getTransTotal()));
        this.field_discount.setText(fmt.format(this.tx.getTotalDiscountTaken()));
    }
    /** displays the appropriate panel in the GUI according to the RS selected in the transaction line list.
     *@param selectedRow contains the selected row.
     */
    private void displaySelected(int selectedRow){
        RevenueSourceBO rs = this.tx.getTxLineList().get(selectedRow).getRevSrc();
        String type = rs.getType();
        try {
            if(type.equals("sale")){    //if a sale revenue source is selected
                SaleBO s = (SaleBO)rs;
                this.field_SKU.setText(s.getProduct().getSKU());
                this.jTabbedPanel.setSelectedIndex(0);
            }else if(type.equals("rental")){    //if a rental revenue source is selected
                ArrayList<String> values = RentalHandler.getInstance().populateRentalPanel((RentalBO)rs);
                this.dateOut.setText(values.get(0));
                this.dateDue.setText(values.get(1));
                this.pricePerDay.setText(values.get(2));
                this.replacementPrice.setText(values.get(3));
                this.maxTimesRented.setText(values.get(4));
                this.lateFeePerDay.setText(values.get(5));
                this.sku.setText(values.get(6));
                this.productID.setText(values.get(7));
                this.description.setText(values.get(8));
                this.jTabbedPanel.setSelectedIndex(1);
            }else if(type.equals("backup")){    //if a backup revenue source is selected
                BackupBO b = (BackupBO)rs;
                this.bkField_addSize.setText(Double.toString(b.getBuSize()));
                this.label_memberID.setText(this.cust.getCustMembership().getMembershipID());   //set the membership id
                this.label_memberName.setText(this.cust.getCustFullName());                     //set the member name
                this.label_backupSize.setText(Double.toString(this.cust.getCustMembership().getBuSize()) + "GB");   //set the existing backup size
                //get today's date for cost calculation
                Calendar cal = Calendar.getInstance();
                Date today = cal.getTime();
                SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
                String todayDate = fmt.format(today);
                //calculate the cost for 6 months and display
                this.label_currentCost.setText("$" + fmt.format(BackupHandler.getInstance().calcPrice(
                        this.cust.getCustMembership().getBuSize(), BackupHandler.getInstance().addNewPeriod(todayDate))));
                if(this.cust.getCustMembership().getBuExpDate() != null){
                    this.label_currentExpDate.setText(this.cust.getCustMembership().getBuExpDate());
                }else{
                    this.label_currentExpDate.setText("No current backup service.");
                }
                this.jTabbedPanel.setSelectedIndex(2);
            }else if(type.equals("repair")){    //if a repair revenue source is selected
                SvcRepairBO sr = (SvcRepairBO)rs;
                this.repField_sku.setText(sr.getProduct().getSKU());
                if(sr.getCompleteDate() != null){
                    this.repField_completeDate.setText(sr.getCompleteDate());
                }
                this.repField_startDate.setText(sr.getStartDate());
                this.repField_laborHrs.setText(Double.toString(sr.getLaborHrs()));
                this.repField_price.setText(fmt.format(sr.getPrice()));
                if(sr.getLastNoticeDate() != null){
                    this.repField_lastNotice.setText(sr.getLastNoticeDate());
                }
                if(sr.getPickUpDate() != null){
                    this.repField_pickUp.setText(sr.getPickUpDate());
                }
                this.repCboBox_contactMethod.setSelectedItem(sr.getContactMethod());
                this.repTxtArea_description.setText(sr.getDescription());
                this.jTabbedPanel.setSelectedIndex(3);
            }else if(type.equals("print")){     //if a print revenue source is selected
                
                this.jTabbedPanel.setSelectedIndex(4);
            }else if(type.equals("conversion")){    //if a conversion revenue source is selected
                
                this.jTabbedPanel.setSelectedIndex(5);
            }else if(type.equals("return")){
                
                this.jTabbedPanel.setSelectedIndex(6);
            }
            this.button_addItem.setEnabled(false);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    /** Clear data from the selected tab
     */
    public void clearData(){
        try {
            //get the displayed tab
            int panelNum = this.jTabbedPanel.getSelectedIndex();
            switch (panelNum){
                case 0:     //Sale tab
                    this.field_SKU.setText("<SKU>");
                    break;
                case 1:     //Rental tab
                    this.dateOut.setText("");
                    this.dateDue.setText("");
                    this.pricePerDay.setText("");
                    this.replacementPrice.setText("");
                    this.maxTimesRented.setText("");
                    this.sku.setText("");
                    this.productID.setText("");
                    this.description.setText("");
                    this.field_lookupRentalItem.setText("<Enter Keyword>");
                    this.rentalCategories_cbo.setSelectedIndex(0);
                    this.rentalList.setListData(new ArrayList<String>().toArray());
                    this.rentalList.updateUI();
                    this.button_addItem.setSelected(false);
                    break;
                case 2:     //Backup tab
                    this.label_memberID.setText("<membership id>");   //set the membership id
                    this.label_memberName.setText("<name>");                     //set the member name
                    this.label_backupSize.setText("<size>");   //set the existing backup size
                    this.label_currentCost.setText("<current cost>");
                    this.label_currentExpDate.setText("<current exp date>");
                    this.bkField_addCost.setText("<cost>");
                    this.bkField_addSize.setText("<size>");
                    break;
                case 3:     //Repair tab
                    this.repField_sku.setText("<SKU>");
                    this.repField_completeDate.setText("<date completed>");
                    this.repField_startDate.setText("<start date>");
                    this.repField_laborHrs.setText("<labor hours>");
                    this.repField_price.setText("<price>");
                    this.repField_lastNotice.setText("<last notice date>");
                    this.repField_pickUp.setText("<pick up date>");
                    this.repCboBox_contactMethod.setSelectedIndex(0);
                    this.repTxtArea_description.setText("");
                    break;
                case 4:     //Prints tab
                    break;
                case 5:      //Conversion tab
                    break;
                case 6:      //return item tab
                    break;
                default:     //no tab selected
                    break;
            }
            this.button_addItem.setEnabled(true);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
}

